--- solib.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/solib.c +++ b/solib.c @@ -311,6 +311,14 @@ solib_bfd_open (char *pathname) found_pathname, bfd_errmsg (bfd_get_error ())); } + /* Check bfd arch. */ + if (bfd_get_arch (abfd) != gdbarch_bfd_arch_info (target_gdbarch)->arch) + { + bfd_close (abfd); + make_cleanup (xfree, found_pathname); + error (_("`%s': ARCH not same with inferior."), found_pathname); + } + return abfd; }