From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130876 invoked by alias); 13 Nov 2019 20:06:19 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 130862 invoked by uid 89); 13 Nov 2019 20:06:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.1 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=no version=3.3.1 spammy= X-HELO: mail-ot1-f66.google.com Received: from mail-ot1-f66.google.com (HELO mail-ot1-f66.google.com) (209.85.210.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Nov 2019 20:06:17 +0000 Received: by mail-ot1-f66.google.com with SMTP id u13so2784694ote.0 for ; Wed, 13 Nov 2019 12:06:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=v8uSgwqziKGhjwshxwquwqfqLIU3apf0ykC91VzZQ/Q=; b=QsypFgDI6kGQzPYbeWJKRQ6CQdYhpdpw5KPw6adZQl6DJvO3XvtuB14gvWUa6q7xHF 7BFs9z37nPHevnVcY2+/QwAu4eJSkm1n11YfD4uD06a9B3//kmE6WqbPqvIZLS7kq09p DR/aSQdI4Tmf2c62KCC6EMJzp9Hu10uB5o9oN/dKH/YL9ie7yE9fWTYYGUQEvygzWVAA 4hTH9KPvAz1yEZRriLMgriXZUaa1XduCPfCh/r+4E17L5MzdLWqQYg2aQzYMFKdyP728 OT/hCUjEBVLBW/GNF8WwoB1hDldoYLK4QG3/cd9DcUIHgLpCegbeRHb7J7/F43yYJeie 1vzQ== MIME-Version: 1.0 References: <20191104181407.554C52816A@gnutoolchain-gerrit.osci.io> In-Reply-To: From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Wed, 13 Nov 2019 20:06:00 -0000 Message-ID: Subject: Re: [pushed] Add static_asserts for the sizes of space-critical structs To: Szabolcs Nagy Cc: "tromey@sourceware.org" , "gdb-patches@sourceware.org" , nd Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-11/txt/msg00371.txt.bz2 On Wed, Nov 13, 2019 at 1:47 AM Szabolcs Nagy wrote: > > 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 > > > > * 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 Tromey's patch at https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/611 will fix this. Christian > > 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)); > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~