char leading_char;
install_minimal_symbols (struct objfile *objfile){  int bindex;  int mcount;  struct msym_bunch *bunch;  struct minimal_symbol *msymbols;  int alloc_count;  char leading_char;  if (msym_count > 0)    {      /* Allocate enough space in the obstack, into which we will gather the         bunches of new and existing minimal symbols, sort them, and then         compact out the duplicate entries.  Once we have a final table,         we will give back the excess space.  */      alloc_count = msym_count + objfile->minimal_symbol_count + 1;      obstack_blank (&objfile->objfile_obstack,		     alloc_count * sizeof (struct minimal_symbol));      msymbols = (struct minimal_symbol *)	obstack_base (&objfile->objfile_obstack);      /* Copy in the existing minimal symbols, if there are any.  */      if (objfile->minimal_symbol_count)	memcpy ((char *) msymbols, (char *) objfile->msymbols,	    objfile->minimal_symbol_count * sizeof (struct minimal_symbol));      /* Walk through the list of minimal symbol bunches, adding each symbol         to the new contiguous array of symbols.  Note that we start with the         current, possibly partially filled bunch (thus we use the current         msym_bunch_index for the first bunch we copy over), and thereafter         each bunch is full. */      mcount = objfile->minimal_symbol_count;      leading_char = get_symbol_leading_char (objfile->obfd);      for (bunch = msym_bunch; bunch != NULL; bunch = bunch->next)	{	  for (bindex = 0; bindex < msym_bunch_index; bindex++, mcount++)	    {	      msymbols[mcount] = bunch->contents[bindex];	      if (SYMBOL_LINKAGE_NAME (&msymbols[mcount])[0] == leading_char)		{		  SYMBOL_LINKAGE_NAME (&msymbols[mcount])++;		}	    }	  msym_bunch_index = BUNCH_SIZE;	}      /* Sort the minimal symbols by address.  */      qsort (msymbols, mcount, sizeof (struct minimal_symbol),	     compare_minimal_symbols);      /* Compact out any duplicates, and free up whatever space we are         no longer using.  */      mcount = compact_minimal_symbols (msymbols, mcount, objfile);      obstack_blank (&objfile->objfile_obstack,	       (mcount + 1 - alloc_count) * sizeof (struct minimal_symbol));      msymbols = (struct minimal_symbol *)	obstack_finish (&objfile->objfile_obstack);      /* We also terminate the minimal symbol table with a "null symbol",         which is *not* included in the size of the table.  This makes it         easier to find the end of the table when we are handed a pointer         to some symbol in the middle of it.  Zero out the fields in the         "null symbol" allocated at the end of the array.  Note that the         symbol count does *not* include this null symbol, which is why it         is indexed by mcount and not mcount-1. */      SYMBOL_LINKAGE_NAME (&msymbols[mcount]) = NULL;      SYMBOL_VALUE_ADDRESS (&msymbols[mcount]) = 0;      MSYMBOL_INFO (&msymbols[mcount]) = NULL;      MSYMBOL_SIZE (&msymbols[mcount]) = 0;      MSYMBOL_TYPE (&msymbols[mcount]) = mst_unknown;      SYMBOL_INIT_LANGUAGE_SPECIFIC (&msymbols[mcount], language_unknown);      /* Attach the minimal symbol table to the specified objfile.         The strings themselves are also located in the objfile_obstack         of this objfile.  */      objfile->minimal_symbol_count = mcount;      objfile->msymbols = msymbols;      /* Try to guess the appropriate C++ ABI by looking at the names 	 of the minimal symbols in the table.  */      {	int i;	for (i = 0; i < mcount; i++)	  {	    /* If a symbol's name starts with _Z and was successfully	       demangled, then we can assume we've found a GNU v3 symbol.	       For now we set the C++ ABI globally; if the user is	       mixing ABIs then the user will need to "set cp-abi"	       manually.  */	    const char *name = SYMBOL_LINKAGE_NAME (&objfile->msymbols[i]);	    if (name[0] == '_' && name[1] == 'Z'		&& SYMBOL_DEMANGLED_NAME (&objfile->msymbols[i]) != NULL)	      {		set_cp_abi_as_auto_default ("gnu-v3");		break;	      }	  }      }      /* Now build the hash tables; we can't do this incrementally         at an earlier point since we weren't finished with the obstack	 yet.  (And if the msymbol obstack gets moved, all the internal	 pointers to other msymbols need to be adjusted.) */      build_minimal_symbol_hash_tables (objfile);    }}