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-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 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 dcvr.yhbt.net (Postfix) with ESMTPS id 8DFB31F4C0 for ; Thu, 31 Oct 2019 19:21:12 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:message-id:subject:references :reply-to:mime-version:content-transfer-encoding:content-type; q=dns; s=default; b=x0bTWSpuDKW+4/xIh6UbqPciOfo1uDwILTyCGfCHtkt h2KueFf1Sg3k9L0x2PqZhPJSER9iIeRNvLz9lm2sbraWzZFNadHOpg9bcBtjQVyc yzYjd2PrLCCC7ORLow43u7JVkLcHZcdr+84PLzpwZZzM0mte/ij/setn9m91iHNQ = 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:date:from:to:cc:message-id:subject:references :reply-to:mime-version:content-transfer-encoding:content-type; s=default; bh=6mEaCXBfwvBek+/mcGBzj91wcsE=; b=U5HWtZJRkyFwPBjCU hlk0XmS0C+1enpX+ntuTZ+TI7LdOsrZg5L34LgW5ZHBRhAnrMxkoCTtnjk5WlJoc rOAI5TJKRJbMIV0bqcp98pl2TbWlXAx/QSCEgEpOhdpfBEmxoHC+s7Tv0ZpHD6Db IcJmA5UP5gKXe0BoSl6JmccuzI= Received: (qmail 120099 invoked by alias); 31 Oct 2019 19:20:51 -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 Received: (qmail 120048 invoked by uid 89); 31 Oct 2019 19:20:51 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx1.osci.io X-Gerrit-PatchSet: 1 Date: Thu, 31 Oct 2019 15:20:40 -0400 From: "Florian Weimer (Code Review)" To: libc-alpha@sourceware.org Cc: Florian Weimer Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] Clarify purpose of assert in _dl_lookup_symbol_x X-Gerrit-Change-Id: I3384349cef90cfd91862ebc34a4053f0c0a99404 X-Gerrit-Change-Number: 469 X-Gerrit-ChangeURL: X-Gerrit-Commit: 5a292b76a45ca8aa1e7c516a95b83bf4d593d9ab References: Reply-To: fweimer@redhat.com, fweimer@redhat.com, libc-alpha@sourceware.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3-75-g9005159e5d Content-Type: text/plain; charset=UTF-8 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/469 ...................................................................... Clarify purpose of assert in _dl_lookup_symbol_x Only one of the currently defined flags is incompatible with versioned symbol lookups, so it makes sense to check for that flag and not its complement. Change-Id: I3384349cef90cfd91862ebc34a4053f0c0a99404 --- M elf/dl-lookup.c 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c index fd44cd4..aaaf437 100644 --- a/elf/dl-lookup.c +++ b/elf/dl-lookup.c @@ -792,11 +792,9 @@ bump_num_relocations (); - /* No other flag than DL_LOOKUP_ADD_DEPENDENCY or DL_LOOKUP_GSCOPE_LOCK - is allowed if we look up a versioned symbol. */ - assert (version == NULL - || (flags & ~(DL_LOOKUP_ADD_DEPENDENCY | DL_LOOKUP_GSCOPE_LOCK)) - == 0); + /* DL_LOOKUP_RETURN_NEWEST does not make sense for versioned + lookups. */ + assert (version == NULL || !(flags & DL_LOOKUP_RETURN_NEWEST)); size_t i = 0; if (__glibc_unlikely (skip_map != NULL)) -- Gerrit-Project: glibc Gerrit-Branch: master Gerrit-Change-Id: I3384349cef90cfd91862ebc34a4053f0c0a99404 Gerrit-Change-Number: 469 Gerrit-PatchSet: 1 Gerrit-Owner: Florian Weimer Gerrit-MessageType: newchange