aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 35b6725..b7d578f 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -48,6 +48,7 @@
#include "dictionary.h"
#include "source.h"
#include "addrmap.h"
+#include "arch-utils.h"
/* Prototypes for local functions */
@@ -187,6 +188,9 @@ allocate_objfile (bfd *abfd, int flags)
}
if (abfd != NULL)
{
+ /* Look up the gdbarch associated with the BFD. */
+ objfile->gdbarch = gdbarch_from_bfd (abfd);
+
objfile->name = xstrdup (bfd_get_filename (abfd));
objfile->mtime = bfd_get_mtime (abfd);
@@ -234,6 +238,13 @@ allocate_objfile (bfd *abfd, int flags)
return (objfile);
}
+/* Retrieve the gdbarch associated with OBJFILE. */
+struct gdbarch *
+get_objfile_arch (struct objfile *objfile)
+{
+ return objfile->gdbarch;
+}
+
/* Initialize entry point information for this objfile. */
void