From patchwork Tue Feb 25 22:22:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 38313 Received: (qmail 60408 invoked by alias); 25 Feb 2020 22:22:49 -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 60303 invoked by uid 89); 25 Feb 2020 22:22:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.45.38) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Feb 2020 22:22:48 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 5D0BA400D283B for ; Tue, 25 Feb 2020 16:22:46 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 6ibGj7PVORP4z6ibGjWKtz; Tue, 25 Feb 2020 16:22:46 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GLjVibT3VqCkLkllUGCiyyjj48AnRZNJqMp9I5yy3NM=; b=qGIziLOMka1k82+Xn1kBDfcrxb +ejy1Y2tbXFtekTXdFWnN2Q8gpcjtQo2bWAkhOfqks3jMo8A7tWUqjVTT6E2hkZAg2Itx7e4W2a6l xJv5e+iy3xETOTO+0r/QHLk0X; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:55644 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1j6ibG-000r0B-2w; Tue, 25 Feb 2020 15:22:46 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 1/6] Fix CORE_ADDR size assertion in symfile-mem.c Date: Tue, 25 Feb 2020 15:22:38 -0700 Message-Id: <20200225222243.8260-2-tom@tromey.com> In-Reply-To: <20200225222243.8260-1-tom@tromey.com> References: <20200225222243.8260-1-tom@tromey.com> symfile-mem.c has some assertions about the size of various types, to ensure that gdb and BFD don't get out of sync in a way that would cause bugs. Once CORE_ADDR is always 64-bit, one of these assertions can fail for a 32-bit BFD build. However, the real requirement here is just that CORE_ADDR is wider -- because this code promotes a bfd_vma to a CORE_ADDR. This patch corrects the assert. gdb/ChangeLog 2020-02-25 Tom Tromey * symfile-mem.c: Update CORE_ADDR size assert. --- gdb/ChangeLog | 4 ++++ gdb/symfile-mem.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c index a62d0d0c8f4..e2d2e43d7fa 100644 --- a/gdb/symfile-mem.c +++ b/gdb/symfile-mem.c @@ -57,7 +57,7 @@ /* Verify parameters of target_read_memory_bfd and target_read_memory are compatible. */ -gdb_static_assert (sizeof (CORE_ADDR) == sizeof (bfd_vma)); +gdb_static_assert (sizeof (CORE_ADDR) >= sizeof (bfd_vma)); gdb_static_assert (sizeof (gdb_byte) == sizeof (bfd_byte)); gdb_static_assert (sizeof (ssize_t) <= sizeof (bfd_size_type));