[pushed] Add static_asserts for the sizes of space-critical structs

Szabolcs Nagy Szabolcs.Nagy@arm.com
Wed Nov 13 09:47:00 GMT 2019


On 04/11/2019 18:14, Sourceware to Gerrit sync (Code Review) wrote:
> Sourceware to Gerrit sync has submitted this change.
> 
> Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/306
> ......................................................................
> 
> Add static_asserts for the sizes of space-critical structs
> 
> Specifically the three structs mentioned in symtab.h:
> - general_symbol_info
> - symbol
> - partial_symbol
> 
> This ensures that those structs won't accidentally get bigger.
> 
> gdb/ChangeLog:
> 
> 2019-11-04  Christian Biesinger  <cbiesinger@google.com>
> 
> 	* psympriv.h: Add static_asserts for sizeof (general_symbol_info)
> 	and sizeof (symbol).
> 	* symtab.h: Add a static_assert for sizeof (partial_symbol).
> 
> Change-Id: Idd68320aa3e79ee7cc749019724636a58ce4b9c6

armhf build fails since this commit:

https://gdb-buildbot.osci.io/#/builders/29/builds/650

gdb/symtab.h:453:6: error: static assertion failed
  452 | gdb_static_assert ((sizeof (void *) == 8 && sizeof (general_symbol_info) == 32)
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  453 |      || (sizeof (void *) == 4
      |      ^~~~~~~~~~~~~~~~~~~~~~~~
  454 |          && sizeof (general_symbol_info) == 20));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


More information about the Gdb-patches mailing list