Daniel Jacobowitz wrote: > > I think we should finish up this patch, and then proceed from there. > > Should we use this optimization for all global psymtabs? If so, then > we ought to do it in common code so that all the other symbol readers, > like stabs, benefit. > Ok, here is simplified, but with broader consequences patch. The patch now affects all readers that use add_psymbol_to_list by not allowing duplicate partial symbols in the global psymbol list (for a given objfile). Tested on linux dwarf2 format, no regression. I did not test other debug formats. Thanks, Aleksandar ChangeLog * bcache.c (bcache_data): Call bcache_added function. (bcache_added): New function name. Body of function bcache_data is used here with the addition of 'added' argument. * bcache.h (bcache_added): New function. * symfile.c (add_psymbol_to_bcache): New helper function, takes part of work from add_psymbol_to_list - initializes partial symbol and stashes it in objfile's cache. (append_psymbol_to_list): New helper function, takes other part of work from add_psymbol_to_list - adds partial symbol to the given list. (add_psymbol_to_list): Call helper functions instead of doing work here. If adding to global list, do not duplicate partial symbols in the partial symtab.