From patchwork Thu Jul 8 16:32:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Dasmohapatra X-Patchwork-Id: 44259 X-Patchwork-Delegate: azanella@linux.vnet.ibm.com 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 239BC3AA7C9C for ; Thu, 8 Jul 2021 16:37:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 239BC3AA7C9C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1625762276; bh=fTmVeLRkiREDBhyKvZ27IW2/G2LPt+XKZl4OT1+mw2w=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=JfGHrFU/Lba9SofNuX544fx4buKawzT2Eh5sIcBAVsd900JhrfuW5IK8a8Yc6JSez c8Gs5VmwlEeiOmp4ur6Z6ph3GVPpsWPguluRE+N4kmA0DsYHpgUDQQZEx+FgeCcC5Q Urb8DX7lbbhVBORpCbRuQUINwm+MAeBPXMRjm9Eo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by sourceware.org (Postfix) with ESMTPS id CC465399C02F for ; Thu, 8 Jul 2021 16:33:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CC465399C02F Received: from noise.cbg.collabora.co.uk (unknown [IPv6:2001:4d48:ad5c:ef00:8e70:5aff:fe59:c29c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vivek) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 9AB801F43F5E for ; Thu, 8 Jul 2021 17:33:03 +0100 (BST) To: libc-alpha@sourceware.org Subject: [RFC][PATCH v12 7/8] Restore separate libc loading for the TLS/namespace storage test Date: Thu, 8 Jul 2021 17:32:54 +0100 Message-Id: <20210708163255.812-8-vivek@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210708163255.812-1-vivek@collabora.com> References: <20210708163255.812-1-vivek@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , X-Patchwork-Original-From: =?utf-8?q?Vivek_Das=C2=A0Mohapatra_via_Libc-alpha?= From: Vivek Dasmohapatra Reply-To: =?utf-8?q?Vivek_Das=C2=A0Mohapatra?= Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" tst-tls-ie-dlmopen checks to see that new namespaces consume TLS memory as expected: This does not happen when new namespaces share the same libc instance (since TLS is allocated only when a new libc instance insitialises its threading infrastructure). Adding RTLD_ISOLATE to the dlmopen flags in the test restores the old behaviour which allows the test to check what it actually needs to. Reviewed-by: Adhemerval Zanella --- elf/tst-tls-ie-dlmopen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elf/tst-tls-ie-dlmopen.c b/elf/tst-tls-ie-dlmopen.c index a579d72d2d..e67017db2d 100644 --- a/elf/tst-tls-ie-dlmopen.c +++ b/elf/tst-tls-ie-dlmopen.c @@ -53,7 +53,7 @@ static void * load_and_access (Lmid_t lmid, const char *mod, const char *func) { /* Load module with TLS. */ - void *p = xdlmopen (lmid, mod, RTLD_NOW); + void *p = xdlmopen (lmid, mod, RTLD_NOW|RTLD_ISOLATE); /* Access the TLS variable to ensure it is allocated. */ void (*f) (void) = (void (*) (void))xdlsym (p, func); f (); @@ -95,7 +95,7 @@ do_test (void) than 1024 bytes are available (exact number depends on TLS optimizations and the libc TLS use). */ printf ("The next dlmopen should fail...\n"); - void *p = dlmopen (LM_ID_BASE, "tst-tls-ie-mod4.so", RTLD_NOW); + void *p = dlmopen (LM_ID_BASE, "tst-tls-ie-mod4.so", RTLD_NOW|RTLD_ISOLATE); if (p != NULL) FAIL_EXIT1 ("error: expected dlmopen to fail because there is " "not enough surplus static TLS.\n");