From patchwork Wed Oct 30 16:18:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 35475 Received: (qmail 119657 invoked by alias); 30 Oct 2019 16:19:01 -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 118364 invoked by uid 89); 30 Oct 2019 16:19:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Oct 2019 16:19:00 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 8C3FB20277; Wed, 30 Oct 2019 12:18:58 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 51C52203AF for ; Wed, 30 Oct 2019 12:18:56 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id AB83620AF6 for ; Wed, 30 Oct 2019 12:18:54 -0400 (EDT) X-Gerrit-PatchSet: 1 Date: Wed, 30 Oct 2019 12:18:54 -0400 From: "Luis Machado (Code Review)" To: gdb-patches@sourceware.org Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] [ARM] Store exception handling information per-bfd instead of per-obj... X-Gerrit-Change-Id: Ia7b3208ea8d788414600fa6d770ac76db0562859 X-Gerrit-Change-Number: 448 X-Gerrit-ChangeURL: X-Gerrit-Commit: f2820566e0e44d869d68934e6d8a6b39698727fe References: Reply-To: luis.machado@linaro.org, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-74-g460fb0f7e9 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/448 ...................................................................... [ARM] Store exception handling information per-bfd instead of per-objfile Based on feedback from Tromey, update the use of objfile_key in gdb/arm-tdep.c to use bfd_key instead. That way we don't have to re-create the exception handling data all over again if it was done before for the same BFD. OK? 2019-10-30 Luis Machado gdb/ChangeLog: * arm-tdep.c (arm_exidx_data_key): Use bfd_key instead of objfile_key. (arm_exidx_new_objfile): Adjust to use objfile->obfd instead of objfile to fetch per-bfd data. (arm_find_exidx_entry): Likewise. Signed-off-by: Luis Machado Change-Id: Ia7b3208ea8d788414600fa6d770ac76db0562859 --- M gdb/arm-tdep.c 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 8694618..48772d7 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -1999,7 +1999,8 @@ std::vector> section_maps; }; -static const struct objfile_key arm_exidx_data_key; +/* Per-BFD key to store exception handling information. */ +static const struct bfd_key arm_exidx_data_key; static struct obj_section * arm_obj_section_from_vma (struct objfile *objfile, bfd_vma vma) @@ -2043,7 +2044,7 @@ LONGEST i; /* If we've already touched this file, do nothing. */ - if (!objfile || arm_exidx_data_key.get (objfile) != NULL) + if (!objfile || arm_exidx_data_key.get (objfile->obfd) != NULL) return; /* Read contents of exception table and index. */ @@ -2074,7 +2075,7 @@ } /* Allocate exception table data structure. */ - data = arm_exidx_data_key.emplace (objfile); + data = arm_exidx_data_key.emplace (objfile->obfd); data->section_maps.resize (objfile->obfd->section_count); /* Fill in exception table. */ @@ -2246,7 +2247,7 @@ struct arm_exidx_data *data; struct arm_exidx_entry map_key = { memaddr - obj_section_addr (sec), 0 }; - data = arm_exidx_data_key.get (sec->objfile); + data = arm_exidx_data_key.get (sec->objfile->obfd); if (data != NULL) { std::vector &map