Hi, I missed the DWARF-5 deadline so I have submitted this for DWARF-6 (not yet on http://dwarfstd.org ): ------------------------------------------------------------------------------ .gdb_index contained an attribute for each symbol whether it is DW_AT_external or not. /* Whether the symbol is in GLOBAL_BLOCK (== 0) or STATIC_BLOCK (== 1). */ #define GDB_INDEX_SYMBOL_STATIC_SHIFT 31 #define GDB_INDEX_SYMBOL_STATIC_MASK 1 The reason is: Performance issue with .gdb_index and large numbers of shared libs https://sourceware.org/bugzilla/show_bug.cgi?id=14125 When .gdb_index is in use there isn't a bit that specifies GLOBAL_BLOCK vs STATIC_BLOCK, so if something is in STATIC_BLOCK (say "int") it matches so gdb will expand the symbol table, but the match doesn't take into account the block kind. So gdb will proceed to expand one symbol table from every objfile looking for "int" in GLOBAL_BLOCK, finding it, but not using it. Only after that is done will GDB try STATIC_BLOCK. In a large enough app (e.g., >1000 shared libs) this is painful. Proposing and asking for pre-allocation: DW_IDX_static = 6 = DW_FORM_flag_present = DIE's DW_AT_external is not present DW_IDX_external = 7 = DW_FORM_flag_present = DIE's DW_AT_external is present ------------------------------------------------------------------------------ If those new DW_IDX_* get allocated in a reasonable time GDB could already use them, otherwise sending the patch below. These symbols are both produced and consumed only by GDB, not by GCC. Jan