Hi Tom,

Thank you for your feedback. I have sent a v3 of this patch with the suggestions.

>> +  bfd *abfd = objfile->obfd.get ();
>> +  long do_we_need_storage = bfd_get_symtab_upper_bound (abfd);
>> +
>> +  if (do_we_need_storage <= 0)
>> +    return;
>> +
>> +  gdb::unique_xmalloc_ptr<asymbol *> sym_table
>> +    ((asymbol **) xmalloc (do_we_need_storage));
>> +  /* Get the number of symbols we need.  */
>> +  int number_of_symbols = bfd_canonicalize_symtab (abfd, sym_table.get());
>> +
>> +  /* Return on error.  */
>> +  if (number_of_symbols < 0)
>> +      return;

>This code should be replaced with a call to >gdb_bfd_canonicalize_symtab.
>That was added to avoid some pathological behavior, see the >?>comment in
>gdb_bfd.h and/or the associated bug.

>Since you don't want an error here you should pass 'false’ for
>should_throw.

>I forgot about the existence of this earlier and only remembered it >when
>I was looking at something else…

Yeah, it is a nice idea and glad you suggested it. 

Thanks once again.

Have a nice day ahead.

Regards, 
Aditya.