Hi, this patch introduces a framework for looking up multiply defined global symbols from shared libraries. Solib handler like for example solib-svr4.c can now install a callback to implement a library-specific routine for looking up global symbols. As an example I implemented a special lookup routine for ELF shared libraries linked with -Bsymbolic. While the focus is within such a library, the global symbol lookup shall first search for the symbol within this library and then go through the main executable if not found. The patch also includes a testcase for this new feature. The testsuite showed no regressions. I would appreciate your comment on this patch. Would this be ok for mainline? Thanks in advance. ChangeLog: * cp-namespace.c (lookup_symbol_file): Add block to call for lookup_symbol_global. * Makefile.in (solist_h): Update dependencies. (solib.o): Likewise. (symtab.o): Likewise. * solib.c: New include "symtab.h". (solib_global_lookup): New function. * solib-svr4.c (has_SYMBOLIC): New function. (elf_lookup_lib_symbol): New function. (_initialize_svr4_solib): Add elf_lookup_lib_symbol to svr4_so_ops. * solist.h: New include "symtab.h". (target_so_ops): New member lookup_lib_global_symbol. (solib_global_lookup): Declare. * symtab.c: New include "solist.h". (lookup_objfile_from_block): New function. (lookup_global_symbol_from_objfile): New function. (basic_lookup_symbol_nonlocal): Add block to call for lookup_symbol_global. (lookup_symbol_global): Change lookup order. First call solib_global_lookup then lookup global symbol in both symtab and psymtab. * symtab.h (lookup_symbol_global): Add block to declaration. (lookup_objfile_from_block): Declare. (lookup_global_symbol_from_objfile): Declare. * gdb.base/libmd.c: New file for testcase. * gdb.base/libmd.h: Likewise. * gdb.base/solib_symbol.c: Likewise. * gdb.base/solib_symbol.exp: New testcase for multiply defined global symbol lookup. -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com