From patchwork Thu Dec 11 17:22:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 420185 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6F7C91400D5 for ; Fri, 12 Dec 2014 04:23:11 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:subject:from:reply-to:to:cc:date :in-reply-to:references:content-type:content-transfer-encoding :mime-version; q=dns; s=default; b=QVhZpYnYvpjtO13Mh1zVT2ZyVfhVh c4buYMxd6DQqhUassnkYaAtT4xMIMKNFuG2TFrwhP/z2wc7k0axESisvsWv2MrJV WVkEsv+LVG34Rgm+hHZ1hLOmIhCVIl0xePncsQ0Rt3VUiA9y0bdylB8dEtuCd84q 302vp0WPN7rn6A= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:subject:from:reply-to:to:cc:date :in-reply-to:references:content-type:content-transfer-encoding :mime-version; s=default; bh=2tHbS6H1jfslY6hjhHNYWPmLqxs=; b=iwB JuvRPO5r8rRFtzDRhSkxzaADzBloe4+z/bjAxC9EeYOFpyPc5ZplIrVYkMYLboAy G6uf0EkFUSQAMCKvIMQtqGl/ogwJRfSF5pGDpWFvKYS+59FmjdlGq0pfyO++ScBA FZbclly3+AzrnNg54+8YuDpcKiBUVJZIe2HNfzHc= Received: (qmail 13143 invoked by alias); 11 Dec 2014 17:23:05 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 13129 invoked by uid 89); 11 Dec 2014 17:23:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Message-ID: <1418318568.2196.145.camel@ubuntu-sellcey> Subject: Re: [Patch, MIPS] Fix warning in sysdeps/mips/dl-trampoline.c From: Steve Ellcey Reply-To: To: Carlos O'Donell CC: Date: Thu, 11 Dec 2014 09:22:48 -0800 In-Reply-To: <5489C6E5.9030306@redhat.com> References: <872cdd55-2333-4304-9335-3ca5574f30c5@BAMAIL02.ba.imgtec.org> <5488ECDE.6070702@redhat.com> <1418314875.2196.141.camel@ubuntu-sellcey> <5489C6E5.9030306@redhat.com> MIME-Version: 1.0 On Thu, 2014-12-11 at 11:31 -0500, Carlos O'Donell wrote: > On 12/11/2014 11:21 AM, Steve Ellcey wrote: > > On Wed, 2014-12-10 at 20:01 -0500, Carlos O'Donell wrote: > > > >> Why not "switch (l->l_info[VERSYMIDX (DT_VERSYM)] != NULL ? 0 : 1)" to > >> avoid the (int) case potentially hiding future type errors? > > > > That seems reasonable but shouldn't it be "switch (l->l_info[VERSYMIDX > > (DT_VERSYM)] != NULL ? 1 : 0)" I.e. return 1 if the boolean expression > > is true and 0 if the boolean expression is false? > > Yes, you are correct, my mistake. > > Cheers, > Carlos. OK, here is what I am currently testing. OK for checkin if my testing finishes with no regressions? Steve Ellcey sellcey@imgtec.com 2014-12-11 Steve Ellcey * sysdeps/mips/dl-trampoline.c: Modify switch expression. diff --git a/sysdeps/mips/dl-trampoline.c b/sysdeps/mips/dl-trampoline.c index f565654..66a1ea1 100644 --- a/sysdeps/mips/dl-trampoline.c +++ b/sysdeps/mips/dl-trampoline.c @@ -139,7 +139,7 @@ __dl_runtime_resolve (ElfW(Word) sym_index, /* FIXME: The symbol versioning stuff is not tested yet. */ if (__builtin_expect (ELFW(ST_VISIBILITY) (sym->st_other), 0) == 0) { - switch (l->l_info[VERSYMIDX (DT_VERSYM)] != NULL) + switch (l->l_info[VERSYMIDX (DT_VERSYM)] != NULL ? 1 : 0) { default: {