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 [8.43.85.97]) (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 B61131F4B4 for ; Tue, 22 Sep 2020 12:13:14 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9780B3987803; Tue, 22 Sep 2020 12:13:13 +0000 (GMT) Received: from mx1.emlix.com (mx1.emlix.com [136.243.223.33]) by sourceware.org (Postfix) with ESMTPS id 959BD3870898 for ; Tue, 22 Sep 2020 12:13:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 959BD3870898 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 B05C55FB5E for ; Tue, 22 Sep 2020 14:13:01 +0200 (CEST) From: Rolf Eike Beer To: libc-alpha@sourceware.org Subject: [PATCH 2/2] rtld: turn "Already zero" assumptions into asserts Date: Tue, 22 Sep 2020 14:13:00 +0200 Message-Id: <20200922121300.3503-2-eb@emlix.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200922121300.3503-1-eb@emlix.com> References: <20200922121300.3503-1-eb@emlix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" --- 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); GL(dl_rtld_map).l_libname = &_dl_rtld_libname; /* Ordinarilly, we would get additional names for the loader from @@ -1470,7 +1470,7 @@ of this helper program; chances are you did not intend to run this program.\n\ if (p != NULL) { _dl_rtld_libname2.name = p; - /* _dl_rtld_libname2.next = NULL; Already zero. */ + assert(_dl_rtld_libname2.next == NULL); _dl_rtld_libname.next = &_dl_rtld_libname2; } } @@ -1555,7 +1555,7 @@ of this helper program; chances are you did not intend to run this program.\n\ /* We were invoked directly, so the program might not have a PT_INTERP. */ _dl_rtld_libname.name = GL(dl_rtld_map).l_name; - /* _dl_rtld_libname.next = NULL; Already zero. */ + assert(_dl_rtld_libname.next == NULL); GL(dl_rtld_map).l_libname = &_dl_rtld_libname; } else -- 2.28.0