From: Tom Tromey Date: Thu, 12 Mar 2020 19:32:15 +0000 (-0600) Subject: Fix CORE_ADDR size assertion in symfile-mem.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=64f251023bcbd068861d4cb83b4e925083e0ea35;p=binutils-gdb.git 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 25538378f3b..3416b414329 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 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));