aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.c
diff options
context:
space:
mode:
authorHui Zhu <teawater@gmail.com>2009-07-09 13:39:17 +0000
committerHui Zhu <teawater@gmail.com>2009-07-09 13:39:17 +0000
commit378d2b72b62e81fcac705ed0d0f102a5bddd6bac (patch)
tree41b608fc30bf548c4cc765ca97ee14bd6392ab7d /gdb/solib.c
parent3a8f7b070dc49e6b283c1ce377ca13f6b8a1b62c (diff)
downloadgdb-378d2b72b62e81fcac705ed0d0f102a5bddd6bac.zip
gdb-378d2b72b62e81fcac705ed0d0f102a5bddd6bac.tar.gz
gdb-378d2b72b62e81fcac705ed0d0f102a5bddd6bac.tar.bz2
2009-07-09 Hui Zhu <teawater@gmail.com>
* solib.c (solib_bfd_open): Output a warning if solib's architecture is not compatible with inferior's architecture.
Diffstat (limited to 'gdb/solib.c')
-rw-r--r--gdb/solib.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index d194ac7..53d5d1b 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;
}