From patchwork Tue Sep 22 12:12:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rolf Eike Beer X-Patchwork-Id: 40470 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 393FC3987839; Tue, 22 Sep 2020 12:13:06 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx1.emlix.com (mx1.emlix.com [136.243.223.33]) by sourceware.org (Postfix) with ESMTPS id 3930D3870898 for ; Tue, 22 Sep 2020 12:13:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3930D3870898 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 AC1CB5FB17 for ; Tue, 22 Sep 2020 14:13:01 +0200 (CEST) From: Rolf Eike Beer To: libc-alpha@sourceware.org Subject: [PATCH 1/2] rtld: fix typo in comment Date: Tue, 22 Sep 2020 14:12:59 +0200 Message-Id: <20200922121300.3503-1-eb@emlix.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elf/rtld.c b/elf/rtld.c index 5b882163fa..99d130cd1c 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -352,7 +352,7 @@ struct rtld_global _rtld_global = }; /* If we would use strong_alias here the compiler would see a non-hidden definition. This would undo the effect of the previous - declaration. So spell out was strong_alias does plus add the + declaration. So spell out what strong_alias does plus add the visibility attribute. */ extern struct rtld_global _rtld_local __attribute__ ((alias ("_rtld_global"), visibility ("hidden"))); From patchwork Tue Sep 22 12:13:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rolf Eike Beer X-Patchwork-Id: 40471 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org 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) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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