From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 286771F4B4 for ; Tue, 22 Sep 2020 12:38:19 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3AAF83987839; Tue, 22 Sep 2020 12:38:18 +0000 (GMT) Received: from mx1.emlix.com (mx1.emlix.com [136.243.223.33]) by sourceware.org (Postfix) with ESMTPS id A601F3987802 for ; Tue, 22 Sep 2020 12:38:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A601F3987802 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=emlix.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=eb@emlix.com Received: from mailer.emlix.com (unknown [81.20.119.6]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.emlix.com (Postfix) with ESMTPS id 8900B5FFF2; Tue, 22 Sep 2020 14:38:14 +0200 (CEST) From: Rolf Eike Beer To: "H.J. Lu" Subject: Re: [PATCH 2/2] rtld: turn "Already zero" assumptions into asserts Date: Tue, 22 Sep 2020 14:38:08 +0200 Message-ID: <5224875.DOkh6Dc2oj@devpool47> Organization: emlix GmbH In-Reply-To: References: <20200922121300.3503-1-eb@emlix.com> <20200922121300.3503-2-eb@emlix.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart15859904.837jSo8saA"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: GNU C Library Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" --nextPart15859904.837jSo8saA Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Rolf Eike Beer To: "H.J. Lu" Cc: GNU C Library Subject: Re: [PATCH 2/2] rtld: turn "Already zero" assumptions into asserts Date: Tue, 22 Sep 2020 14:38:08 +0200 Message-ID: <5224875.DOkh6Dc2oj@devpool47> Organization: emlix GmbH In-Reply-To: References: <20200922121300.3503-1-eb@emlix.com> <20200922121300.3503-2-eb@emlix.com> H.J. Lu wrote: > On Tue, Sep 22, 2020 at 5:13 AM Rolf Eike Beer wrote: > > --- > > > > elf/rtld.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/elf/rtld.c b/elf/rtld.c > > index 99d130cd1c..441d837095 100644 > > --- a/elf/rtld.c > > +++ b/elf/rtld.c > > @@ -1449,7 +1449,7 @@ of this helper program; chances are you did not > > intend to run this program.\n\> > > the shared object is already loaded. */ > > > > _dl_rtld_libname.name = ((const char *) main_map->l_addr > > > > + ph->p_vaddr); > > > > - /* _dl_rtld_libname.next = NULL; Already zero. */ > > + assert(_dl_rtld_libname.next == NULL); > > Space after assert. Same applies to other changes. > and there are > > rtld.c:static struct libname_list _dl_rtld_libname; > rtld.c:static struct libname_list _dl_rtld_libname2; > > There is no need for assert of zero on static variables. Except when by accident the .bss section is not behind the last PT_LOAD and suddenly is not zeroed out anymore and it takes you a while to find out _what_ exactly is broken ;) But fine with me. Eike --nextPart15859904.837jSo8saA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iLMEAAEIAB0WIQQ/Uctzh31xzAxFCLur5FH7Xu2t/AUCX2nwMAAKCRCr5FH7Xu2t /KuQBACdft5xWvxNZwvL+7mVco5fDpOpwzBP6Pz4F0knZccx/3uBXPVAh+8OD0PI UvQxKOgzbyOrcVJydE701FhQMCjUs6GKkyKGOLoxcQdh2EnT8svO66esJxS8XvyL Z6JUOCMjSSeGxv8p4rXd+pMARzFhyoMdMDHIEf25jaZB2CrKlA== =buff -----END PGP SIGNATURE----- --nextPart15859904.837jSo8saA--