diff options
author | Tom Tromey <tromey@redhat.com> | 2013-08-20 15:04:51 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-08-20 15:04:51 +0000 |
commit | df6d5441760d6744b7c9e2cc0af4e234417c61b0 (patch) | |
tree | 402d9bc1fa615f63a64846015e72ea2802f719e8 /gdb/elfread.c | |
parent | f5aee5eeb88a99a8fb9d2b57971b0bda035ebc65 (diff) | |
download | gdb-df6d5441760d6744b7c9e2cc0af4e234417c61b0.zip gdb-df6d5441760d6744b7c9e2cc0af4e234417c61b0.tar.gz gdb-df6d5441760d6744b7c9e2cc0af4e234417c61b0.tar.bz2 |
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.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r-- | gdb/elfread.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c index 1aa10d1..d16287a 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -636,7 +636,7 @@ elf_rel_plt_read (struct objfile *objfile, asymbol **dyn_symbol_table) char *string_buffer = NULL; size_t string_buffer_size = 0; struct cleanup *back_to; - struct gdbarch *gdbarch = objfile->gdbarch; + struct gdbarch *gdbarch = get_objfile_arch (objfile); struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr; size_t ptr_size = TYPE_LENGTH (ptr_type); @@ -797,7 +797,7 @@ elf_gnu_ifunc_record_cache (const char *name, CORE_ADDR addr) if (*slot != NULL) { struct elf_gnu_ifunc_cache *entry_found_p = *slot; - struct gdbarch *gdbarch = objfile->gdbarch; + struct gdbarch *gdbarch = get_objfile_arch (objfile); if (entry_found_p->addr != addr) { @@ -877,7 +877,7 @@ elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p) ALL_PSPACE_OBJFILES (current_program_space, objfile) { bfd *obfd = objfile->obfd; - struct gdbarch *gdbarch = objfile->gdbarch; + struct gdbarch *gdbarch = get_objfile_arch (objfile); struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr; size_t ptr_size = TYPE_LENGTH (ptr_type); CORE_ADDR pointer_address, addr; |