+/* Hash table entry structure for the stabs symbols in the main object file.
+ This is used to speed up lookup for symbols in the OSO. */
+
+struct macho_sym_hash_entry
+{
+ struct bfd_hash_entry base;
+ const asymbol *sym;
+};
+
+/* Routine to create an entry in the hash table. */
+
+static struct bfd_hash_entry *
+macho_sym_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
+{
+ struct macho_sym_hash_entry *ret = (struct macho_sym_hash_entry *) entry;
+
+ /* Allocate the structure if it has not already been allocated by a
+ subclass. */
+ if (ret == NULL)
+ ret = (struct macho_sym_hash_entry *) bfd_hash_allocate (table,
+ sizeof (* ret));
+ if (ret == NULL)
+ return NULL;
+
+ /* Call the allocation method of the superclass. */
+ ret = (struct macho_sym_hash_entry *)
+ bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string);
+
+ if (ret)
+ {
+ /* Initialize the local fields. */
+ ret->sym = NULL;
+ }
+
+ return (struct bfd_hash_entry *) ret;
+}
+
+/* Get the value of SYM from the minimal symtab of MAIN_OBJFILE. This is used
+ to get the value of global and common symbols. */
+
+static CORE_ADDR
+macho_resolve_oso_sym_with_minsym (struct objfile *main_objfile, asymbol *sym)
+{
+ /* For common symbol and global symbols, use the min symtab. */
+ struct bound_minimal_symbol msym;
+ const char *name = sym->name;
+
+ if (name[0] == bfd_get_symbol_leading_char (main_objfile->obfd))
+ ++name;
+ msym = lookup_minimal_symbol (name, NULL, main_objfile);
+ if (msym.minsym == NULL)
+ {
+ warning (_("can't find symbol '%s' in minsymtab"), name);
+ return 0;
+ }
+ else
+ return BMSYMBOL_VALUE_ADDRESS (msym);
+}
+
+/* Add oso file OSO/ABFD as a symbol file. */