Fix CORE_ADDR size assertion in symfile-mem.c
authorTom Tromey <tom@tromey.com>
Thu, 12 Mar 2020 19:32:15 +0000 (13:32 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 12 Mar 2020 19:32:15 +0000 (13:32 -0600)
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.

gdb/ChangeLog
gdb/symfile-mem.c

index 25538378f3b2ee258b0c05aea555d315d8921235..3416b414329277c8c863f4982c181103b87d30ae 100644 (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/.
index a62d0d0c8f471ad8433f4138501a8f1d75f8fa5c..e2d2e43d7fa7ba5566795a535070e4bb32ce66a3 100644 (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));
 
This page took 0.027485 seconds and 4 git commands to generate.