move gdbarch object from objfile to per-BFD
This moves the "gdbarch" field from the objfile into the BFD. This field's value is derived from the BFD and is immutable over the lifetime of the BFD. This makes it a reasonable candidate for pushing into the per-BFD object. This is part of the long-term objfile splitting project. In the long run I think this patch will make it simpler to moves types from the objfile to the per-BFD object; but the patch makes sense as a minor cleanup by itself. Built and regtested on x86-64 Fedora 18. * cp-namespace.c (cp_lookup_symbol_imports_or_template): Use get_objfile_arch. * elfread.c (elf_rel_plt_read, elf_gnu_ifunc_record_cache) (elf_gnu_ifunc_resolve_by_got): Use get_objfile_arch. * jit.c (jit_object_close_impl): Update. * jv-lang.c (get_dynamics_objfile): Update. * linespec.c (add_minsym): Use get_dynamics_objfile. * objfiles.c (get_objfile_bfd_data): Initialize 'gdbarch' field. (allocate_objfile): Don't initialize 'gdbarch' field. (get_objfile_arch): Update. * objfiles.h (struct objfile_per_bfd_storage) <gdbarch>: New field, moved from... (struct objfile) <gdbarch>: ... here. Remove. * stap-probe.c (stap_can_evaluate_probe_arguments): Use get_objfile_arch. * symfile.c (init_entry_point_info): Use get_objfile_arch.
This commit is contained in:
parent
f5aee5eeb8
commit
df6d544176
10 changed files with 41 additions and 21 deletions
|
@ -178,6 +178,13 @@ struct objfile_per_bfd_storage
|
|||
|
||||
/* Byte cache for macros. */
|
||||
struct bcache *macro_cache;
|
||||
|
||||
/* The gdbarch associated with the BFD. Note that this gdbarch is
|
||||
determined solely from BFD information, without looking at target
|
||||
information. The gdbarch determined from a running target may
|
||||
differ from this e.g. with respect to register types and names. */
|
||||
|
||||
struct gdbarch *gdbarch;
|
||||
};
|
||||
|
||||
/* Master structure for keeping track of each file from which
|
||||
|
@ -248,13 +255,6 @@ struct objfile
|
|||
|
||||
struct objfile_per_bfd_storage *per_bfd;
|
||||
|
||||
/* The gdbarch associated with the BFD. Note that this gdbarch is
|
||||
determined solely from BFD information, without looking at target
|
||||
information. The gdbarch determined from a running target may
|
||||
differ from this e.g. with respect to register types and names. */
|
||||
|
||||
struct gdbarch *gdbarch;
|
||||
|
||||
/* The modification timestamp of the object file, as of the last time
|
||||
we read its symbols. */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue