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  <tom@tromey.com>

	* symfile-mem.c: Update CORE_ADDR size assert.
This commit is contained in:
Tom Tromey 2020-03-12 13:32:15 -06:00 committed by Tom Tromey
parent 3f512721a8
commit 64f251023b
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2020-03-12 Tom Tromey <tom@tromey.com>
* symfile-mem.c: Update CORE_ADDR size assert.
2020-03-12 Simon Marchi <simon.marchi@efficios.com>
* selftest.m4: Move to gdbsupport/.

View File

@ -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));