From patchwork Tue Nov 12 19:20:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Adhemerval Zanella (Code Review)" X-Patchwork-Id: 1193784 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-106971-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gnutoolchain-gerrit.osci.io Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="nM3gzX52"; dkim-atps=neutral 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 47CHdK17NHz9sNx for ; Wed, 13 Nov 2019 06:20:20 +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:date:from:to:cc:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; q=dns; s=default; b=boLE8DHSAZ44g0rkjaQjepo8s1FlbPH 86TGQgUOAJgVY94dmkY/zLzUDdYwDT2G7P2FYRTmHbbEbzj6CaWHF445CszzOzRO xG8O83eg/Tk4BiByQrD6QPs7FPwMoyPC+kHjitaxcTsjgwIXLkYBJsCJjLllZohi dmAGt5G9pVtM= 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:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; s=default; bh=mgrDZaLHXo9C2F98EUtK6vsVnVg=; b=nM3gz X52PsvDvO4gSyO0CMXH8l/aE1TZkW83vJrHtRgNB1UY3GAK6OHvw2mZF15uG9VXo XBphdFLxiafDK2pUo1t7vbMIFORQ95Qg1PIkCUQu+2sq6zay6AXzlfC6GPlQdsHl uln4jA/TesdUj1sFOcwbIS9MPhuzlBZLxKqstM= Received: (qmail 44348 invoked by alias); 12 Nov 2019 19:20:15 -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 44338 invoked by uid 89); 12 Nov 2019 19:20:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=H*R:D*br, H*R:D*net.br X-HELO: mx1.osci.io X-Gerrit-PatchSet: 4 Date: Tue, 12 Nov 2019 14:20:09 -0500 From: "Sourceware to Gerrit sync (Code Review)" To: Florian Weimer , libc-alpha@sourceware.org Cc: Carlos O'Donell , "Gabriel F. T. Gomes" Auto-Submitted: auto-generated X-Gerrit-MessageType: merged Subject: [pushed] 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: ca136bb0a36d0a7056c926bfe5126873566efe40 In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, gabriel@inconstante.net.br, fweimer@redhat.com, libc-alpha@sourceware.org, carlos@redhat.com MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-76-gf8b6da0ab5 Message-Id: <20191112192009.69B4420AF6@gnutoolchain-gerrit.osci.io> Sourceware to Gerrit sync has submitted this change. 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. Reviewed-by: Carlos O'Donell Reviewed-by: Gabriel F. T. Gomes Change-Id: I3384349cef90cfd91862ebc34a4053f0c0a99404 --- M elf/dl-lookup.c 1 file changed, 3 insertions(+), 5 deletions(-) Approvals: Carlos O'Donell: Looks good to me, approved 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))