Hello, In dwarf2read.c we sort global symbols automatically during the read. This, on large projects, causes long delay at startup. For example, a project our customer has is a C++ project and is fairly large. Here is some statistics to give you an idea: Statistics: Number of psymtabs : 16659 Number of global symbols : 9134742 Number of static symbols : 1021345 The attached patch sorts on first lookup instead of on load. Startup time (i.e. time until I get control when stopped in main) was before the patch: % cumulative self self total time seconds seconds calls s/call s/call name 65.93 21.38 21.38 16 1.34 1.34 strcmp_iw_ordered 5.70 23.23 1.85 10765999 0.00 0.00 bcache_data ... And after the patch: % cumulative self self total time seconds seconds calls s/call s/call name 20.43 1.80 1.80 10765999 0.00 0.00 bcache_data 11.80 2.84 1.04 11137416 0.00 0.00 htab_hash_string 8.74 3.61 0.77 14851934 0.00 0.00 htab_find_slot_with_hash ... Note that 'strcmp_iw_ordered' comes from sort_pst_symbols (and indirectly from qsort); the number '16' in 'calls' column is due to wrap-around. Number of calls is much higher. Testing on linux, no regressions. --- Aleksandar Ristovski QNX Software Systems ChangeLog 2008-02-11 Aleksandar Ristovski * dwarf2read.c (dwarf2_build_psymtabs_hard): Remove call to sort_pst_symbols. It will be done on first lookup. * symfile.c (compare_psymbols): Set globals_sorted flag. * symmisc.c (maintenance_info_psymtabs): Add some statistics to the output. * symtab.c (lookup_partial_symbol): Sort global symbols if not already sorted, then go on with the appropriate lookup. * symtab.h (struct partial_symtab): Add new field globals_sorted.