unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Florian Weimer (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Florian Weimer <fweimer@redhat.com>,
	"Gabriel F. T. Gomes" <gabriel@inconstante.net.br>,
	libc-alpha@sourceware.org
Subject: [review v2] Clarify purpose of assert in _dl_lookup_symbol_x
Date: Tue, 12 Nov 2019 07:51:16 -0500	[thread overview]
Message-ID: <20191112125116.CA12F20AF6@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1572549639000.I3384349cef90cfd91862ebc34a4053f0c0a99404@gnutoolchain-gerrit.osci.io>

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: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
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: 2
Gerrit-Owner: Florian Weimer <fweimer@redhat.com>
Gerrit-Reviewer: Gabriel F. T. Gomes <gabriel@inconstante.net.br>
Gerrit-MessageType: newpatchset

  parent reply	other threads:[~2019-11-12 12:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-31 19:20 [review] Clarify purpose of assert in _dl_lookup_symbol_x Florian Weimer (Code Review)
2019-11-12 12:47 ` Gabriel F. T. Gomes (Code Review)
2019-11-12 12:51 ` Florian Weimer (Code Review) [this message]
2019-11-12 12:52 ` [review v2] " Florian Weimer (Code Review)
2019-11-12 17:24 ` Carlos O'Donell (Code Review)
2019-11-12 17:24 ` [review v3] " Carlos O'Donell (Code Review)
2019-11-12 17:25 ` Carlos O'Donell (Code Review)
2019-11-12 17:26 ` Carlos O'Donell (Code Review)
2019-11-12 19:20 ` [pushed] " Sourceware to Gerrit sync (Code Review)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191112125116.CA12F20AF6@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=fweimer@redhat.com \
    --cc=gabriel@inconstante.net.br \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).