From patchwork Thu Feb 6 12:19:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 317434 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 821E72C0099 for ; Thu, 6 Feb 2014 23:19:55 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7BF998BE74; Thu, 6 Feb 2014 12:19:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XxL7A_6u84DK; Thu, 6 Feb 2014 12:19:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 31C178BE71; Thu, 6 Feb 2014 12:19:51 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id CDD971C2437 for ; Thu, 6 Feb 2014 12:19:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CA4BA8C21B for ; Thu, 6 Feb 2014 12:19:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dlJk2o0XLBFU for ; Thu, 6 Feb 2014 12:19:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from smtprelay.synopsys.com (us01smtprelay-2.synopsys.com [198.182.44.111]) by whitealder.osuosl.org (Postfix) with ESMTPS id 119008C214 for ; Thu, 6 Feb 2014 12:19:49 +0000 (UTC) Received: from us02secmta2.synopsys.com (us02secmta2.synopsys.com [10.12.235.98]) by smtprelay.synopsys.com (Postfix) with ESMTP id DBADF24E0DE2 for ; Thu, 6 Feb 2014 04:19:46 -0800 (PST) Received: from us02secmta2.internal.synopsys.com (us02secmta2.internal.synopsys.com [127.0.0.1]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id D005F55F13 for ; Thu, 6 Feb 2014 04:19:46 -0800 (PST) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by us02secmta2.internal.synopsys.com (Service) with ESMTP id B6DA555F02 for ; Thu, 6 Feb 2014 04:19:46 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id AB50B3A2 for ; Thu, 6 Feb 2014 04:19:46 -0800 (PST) Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2.internal.synopsys.com [10.12.239.237]) by mailhost.synopsys.com (Postfix) with ESMTP id A53553A1 for ; Thu, 6 Feb 2014 04:19:46 -0800 (PST) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.105) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.3.158.1; Thu, 6 Feb 2014 04:19:46 -0800 Received: from vg-E6520.internal.synopsys.com (10.12.197.80) by IN01WEHTCB.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.158.1; Thu, 6 Feb 2014 17:49:42 +0530 From: Vineet Gupta To: Subject: [PATCH 2/2] test/tls/tst-tls8: Fix accessing wrong module Date: Thu, 6 Feb 2014 17:49:22 +0530 Message-ID: <1391689162-1702-2-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1391689162-1702-1-git-send-email-vgupta@synopsys.com> References: <1391689162-1702-1-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 X-Originating-IP: [10.12.197.80] Cc: Vineet Gupta , Francois.Bedard@synopsys.com X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: uclibc-bounces@uclibc.org Sender: uclibc-bounces@uclibc.org Prev fix only catered to build error, this fixes the semantical bug in the code. Signed-off-by: Vineet Gupta --- test/tls/tst-tls8.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/tls/tst-tls8.c b/test/tls/tst-tls8.c index e0dd35bbebfc..140de438ef68 100644 --- a/test/tls/tst-tls8.c +++ b/test/tls/tst-tls8.c @@ -84,23 +84,23 @@ do_test (void) time. The value of the first round is used. */ #ifdef __UCLIBC__ if (modid2 == (size_t) -1) - modid2 = ((struct dyn_elf *)h1)->dyn->l_tls_modid; - else if (((struct dyn_elf *)h1)->dyn->l_tls_modid + modid2 = ((struct dyn_elf *)h2)->dyn->l_tls_modid; + else if (((struct dyn_elf *)h2)->dyn->l_tls_modid != (size_t) modid2) { printf ("round %d: modid now %zd, initially %zd\n", i, - ((struct dyn_elf *)h1)->dyn->l_tls_modid, + ((struct dyn_elf *)h2)->dyn->l_tls_modid, modid2); result = 1; } #else if (modid2 == (size_t) -1) - modid2 = ((struct link_map *) h1)->l_tls_modid; - else if (((struct link_map *) h1)->l_tls_modid != modid2) + modid2 = ((struct link_map *) h2)->l_tls_modid; + else if (((struct link_map *) h2)->l_tls_modid != modid2) { printf ("round %d: modid now %zd, initially %zd\n", - i, ((struct link_map *) h1)->l_tls_modid, modid2); + i, ((struct link_map *) h2)->l_tls_modid, modid2); result = 1; } #endif @@ -178,20 +178,20 @@ do_test (void) We make sure that the module gets assigned the same ID every time. The value of the first round is used. */ #ifdef __UCLIBC__ - if (((struct dyn_elf *)h1)->dyn->l_tls_modid + if (((struct dyn_elf *)h2)->dyn->l_tls_modid != modid2) { printf ("round %d: modid now %zd, initially %zd\n", i, - ((struct dyn_elf *)h1)->dyn->l_tls_modid, + ((struct dyn_elf *)h2)->dyn->l_tls_modid, modid2); result = 1; } #else - if (((struct link_map *) h1)->l_tls_modid != modid2) + if (((struct link_map *) h2)->l_tls_modid != modid2) { printf ("round %d: modid now %zd, initially %zd\n", - i, ((struct link_map *) h1)->l_tls_modid, modid2); + i, ((struct link_map *) h2)->l_tls_modid, modid2); result = 1; } #endif