From patchwork Tue Nov 12 17:24:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 35831 Received: (qmail 37706 invoked by alias); 12 Nov 2019 17:25:02 -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 37698 invoked by uid 89); 12 Nov 2019 17:25:02 -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, HX-Languages-Length:1683, H*R:D*net.br X-HELO: mx1.osci.io X-Gerrit-PatchSet: 3 Date: Tue, 12 Nov 2019 12:24:57 -0500 From: "Carlos O'Donell (Code Review)" To: Florian Weimer , "Gabriel F. T. Gomes" , libc-alpha@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [review v3] 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: c414f25ffb65be5dcef7ec37e46681252fbd88ca In-Reply-To: References: Reply-To: carlos@redhat.com, gabriel@inconstante.net.br, fweimer@redhat.com, libc-alpha@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-76-gf8b6da0ab5 Message-Id: <20191112172458.64CAB20AF6@gnutoolchain-gerrit.osci.io> The original change was created by Florian Weimer. 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(-) 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))