Index: solib-som.c =================================================================== RCS file: /cvs/src/src/gdb/solib-som.c,v retrieving revision 1.1 diff -u -p -r1.1 solib-som.c --- solib-som.c 8 Dec 2004 01:36:42 -0000 1.1 +++ solib-som.c 15 Dec 2004 07:30:02 -0000 @@ -157,7 +157,7 @@ som_relocate_section_addresses (struct s static void som_solib_create_inferior_hook (void) { - struct minimal_symbol *msymbol; + struct minimal_symbol *msymbol, *msymbol2; unsigned int dld_flags, status, have_endo; asection *shlib_info; char buf[4]; @@ -226,33 +226,22 @@ som_solib_create_inferior_hook (void) /* Grrr, this might not be an export symbol! We have to find the export stub. */ - ALL_OBJFILES (objfile) - { - struct unwind_table_entry *u; - struct minimal_symbol *msymbol2; - - /* What a crock. */ - msymbol2 = - lookup_minimal_symbol_solib_trampoline (SYMBOL_LINKAGE_NAME (msymbol), - objfile); - /* Found a symbol with the right name. */ - if (msymbol2) - { - struct unwind_table_entry *u; - /* It must be a shared library trampoline. */ - if (SYMBOL_TYPE (msymbol2) != mst_solib_trampoline) - continue; - - /* It must also be an export stub. */ - u = find_unwind_entry (SYMBOL_VALUE (msymbol2)); - if (!u || u->stub_unwind.stub_type != EXPORT) - continue; - - /* OK. Looks like the correct import stub. */ - anaddr = SYMBOL_VALUE (msymbol2); - dld_cache.hook_stub.address = anaddr; - } - } + ALL_MSYMBOLS (objfile, msymbol2) + { + if (strcmp (SYMBOL_LINKAGE_NAME (msymbol2), + SYMBOL_LINKAGE_NAME (msymbol)) == 0) + { + struct unwind_table_entry *u; + + u = find_unwind_entry (SYMBOL_VALUE (msymbol2)); + if (u != NULL && u->stub_unwind.stub_type == EXPORT) + { + anaddr = SYMBOL_VALUE (msymbol2); + dld_cache.hook_stub.address = anaddr; + break; + } + } + } store_unsigned_integer (buf, 4, anaddr); msymbol = lookup_minimal_symbol ("__dld_hook", NULL, symfile_objfile);