From: Hui Zhu Date: Thu, 9 Jul 2009 13:39:17 +0000 (+0000) Subject: 2009-07-09 Hui Zhu X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=378d2b72b62e81fcac705ed0d0f102a5bddd6bac;p=binutils-gdb.git 2009-07-09 Hui Zhu * solib.c (solib_bfd_open): Output a warning if solib's architecture is not compatible with inferior's architecture. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 82fa8b8426a..e9e9c1971b5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2009-07-09 Hui Zhu + + * solib.c (solib_bfd_open): Output a warning if solib's + architecture is not compatible with inferior's architecture. + 2009-07-09 Ulrich Weigand Jan Kratochvil diff --git a/gdb/solib.c b/gdb/solib.c index d194ac78f96..53d5d1bcb75 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -289,6 +289,7 @@ solib_bfd_open (char *pathname) char *found_pathname; int found_file; bfd *abfd; + const struct bfd_arch_info *b; /* Use target-specific override if present. */ if (ops->bfd_open) @@ -311,6 +312,13 @@ solib_bfd_open (char *pathname) found_pathname, bfd_errmsg (bfd_get_error ())); } + /* Check bfd arch. */ + b = gdbarch_bfd_arch_info (target_gdbarch); + if (b->compatible (b, bfd_get_arch_info (abfd)) != b) + warning (_("`%s': Shared library architecture %s is not compatible " + "with target architecture %s."), found_pathname, + bfd_get_arch_info (abfd)->printable_name, b->printable_name); + return abfd; }