From patchwork Sat Nov 1 02:27:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 3534 Received: (qmail 16220 invoked by alias); 1 Nov 2014 02:28:32 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 16138 invoked by uid 89); 1 Nov 2014 02:28:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f176.google.com Received: from mail-pd0-f176.google.com (HELO mail-pd0-f176.google.com) (209.85.192.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 01 Nov 2014 02:28:04 +0000 Received: by mail-pd0-f176.google.com with SMTP id ft15so8268094pdb.7 for ; Fri, 31 Oct 2014 19:28:02 -0700 (PDT) X-Received: by 10.66.124.130 with SMTP id mi2mr28589200pab.104.1414808882106; Fri, 31 Oct 2014 19:28:02 -0700 (PDT) Received: from sspiff.org (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by mx.google.com with ESMTPSA id o13sm11060383pby.54.2014.10.31.19.28.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Oct 2014 19:28:01 -0700 (PDT) Received: by sspiff.org (sSMTP sendmail emulation); Fri, 31 Oct 2014 19:27:09 -0700 From: Doug Evans To: gdb-patches@sourceware.org Subject: [PATCH] solib_global_lookup: Fetch arch from objfile. Date: Fri, 31 Oct 2014 19:27:09 -0700 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes Hi. solib_global_lookup should be using the objfile's arch, not fetching it from global state. Regression tested on amd64-linux. 2014-10-31 Doug Evans * objfiles.c (get_objfile_arch): Constify. * objfiles.h (get_objfile_arch): Update prototype. * solib.c (solib_global_lookup): Fetch arch from objfile, not target_gdbarch. diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 2a5c15f..38a365c 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -366,8 +366,9 @@ allocate_objfile (bfd *abfd, const char *name, int flags) } /* Retrieve the gdbarch associated with OBJFILE. */ + struct gdbarch * -get_objfile_arch (struct objfile *objfile) +get_objfile_arch (const struct objfile *objfile) { return objfile->per_bfd->gdbarch; } diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 57a94e1..af80c0c 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -465,7 +465,7 @@ struct objfile extern struct objfile *allocate_objfile (bfd *, const char *name, int); -extern struct gdbarch *get_objfile_arch (struct objfile *); +extern struct gdbarch *get_objfile_arch (const struct objfile *); extern int entry_point_address_query (CORE_ADDR *entry_p); diff --git a/gdb/solib.c b/gdb/solib.c index 41250a2..6260dac 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1408,7 +1408,7 @@ solib_global_lookup (const struct objfile *objfile, const char *name, const domain_enum domain) { - const struct target_so_ops *ops = solib_ops (target_gdbarch ()); + const struct target_so_ops *ops = solib_ops (get_objfile_arch (objfile)); if (ops->lookup_lib_global_symbol != NULL) return ops->lookup_lib_global_symbol (objfile, name, domain);