about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-10-31 13:28:26 +0100
committerFlorian Weimer <fweimer@redhat.com>2019-11-12 20:11:04 +0100
commitca136bb0a36d0a7056c926bfe5126873566efe40 (patch)
treece6d50922c72c9674d6bc8c35eecdc5a24f51c15
parentb9f145df85145506f8e61bac38b792584a38d88f (diff)
downloadglibc-ca136bb0a36d0a7056c926bfe5126873566efe40.tar.gz
glibc-ca136bb0a36d0a7056c926bfe5126873566efe40.tar.xz
glibc-ca136bb0a36d0a7056c926bfe5126873566efe40.zip
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 <carlos@redhat.com>
Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
Change-Id: I3384349cef90cfd91862ebc34a4053f0c0a99404
-rw-r--r--elf/dl-lookup.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index fd44cd4101..aaaf43799e 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -792,11 +792,9 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
 
   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))