From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id B47A53842AD7 for ; Thu, 30 Jun 2022 12:47:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B47A53842AD7 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from tarox.wildebeest.org (83-87-18-245.cable.dynamic.v4.ziggo.nl [83.87.18.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id AE89230146AC; Thu, 30 Jun 2022 14:47:12 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 3FA68407903B; Thu, 30 Jun 2022 14:47:12 +0200 (CEST) Message-ID: <9626ffe27319ac372a88c72cb1522d559dc17f3a.camel@klomp.org> Subject: Re: [PATCH] Mark and init shstrtab[_len] and const in optimize_multifile From: Mark Wielaard To: Jakub Jelinek Cc: dwz@sourceware.org Date: Thu, 30 Jun 2022 14:47:12 +0200 In-Reply-To: References: <20220630113455.30700-1-mark@klomp.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: dwz@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Dwz mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2022 12:47:15 -0000 Hi Jakub, On Thu, 2022-06-30 at 13:47 +0200, Jakub Jelinek wrote: > On Thu, Jun 30, 2022 at 01:34:55PM +0200, Mark Wielaard wrote: > > Old gcc (4.8.5) warn that shstrtab and shstrtab_len can be > > clobbered > > by the longjump. Work around that by marking shstrtab_gnu and > > shstrtab_dwarf5 as static and shstrtab and shstrtab_len as const. > > Init shstrtab and shstrtab_len at declaration. > >=20 > > * dwz.c (optimize_multifile): Make shstrtab_[gnu|dwarf5], > > shstrtab[_len] static. shstrtab[_len] init and make const. > > - const char *shstrtab; > > - size_t shstrtab_len; > > + const char *shstrtab =3D dwarf_5 ? shstrtab_dwarf5 : shstrtab_gnu; >=20 > You aren't marking shstrtab as const though, that would be > const char *const shstrtab =3D ... Doh, I always get that wrong. Pushed with that fixed. Thanks, Mark