From 64f251023bcbd068861d4cb83b4e925083e0ea35 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 12 Mar 2020 13:32:15 -0600 Subject: [PATCH] Fix CORE_ADDR size assertion in symfile-mem.c 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-03-12 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/ChangeLog b/gdb/ChangeLog index 25538378f3..3416b41432 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2020-03-12 Tom Tromey + + * symfile-mem.c: Update CORE_ADDR size assert. + 2020-03-12 Simon Marchi * selftest.m4: Move to gdbsupport/. diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c index a62d0d0c8f..e2d2e43d7f 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));