8a8cfb
commit ca136bb0a36d0a7056c926bfe5126873566efe40
8a8cfb
Author: Florian Weimer <fweimer@redhat.com>
8a8cfb
Date:   Thu Oct 31 13:28:26 2019 +0100
8a8cfb
8a8cfb
    Clarify purpose of assert in _dl_lookup_symbol_x
8a8cfb
    
8a8cfb
    Only one of the currently defined flags is incompatible with versioned
8a8cfb
    symbol lookups, so it makes sense to check for that flag and not its
8a8cfb
    complement.
8a8cfb
    
8a8cfb
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
8a8cfb
    Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
8a8cfb
    Change-Id: I3384349cef90cfd91862ebc34a4053f0c0a99404
8a8cfb
8a8cfb
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
8a8cfb
index 1d046caf017b582b..efbdb8deb3c0a9d4 100644
8a8cfb
--- a/elf/dl-lookup.c
8a8cfb
+++ b/elf/dl-lookup.c
8a8cfb
@@ -792,11 +792,9 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
8a8cfb
 
8a8cfb
   bump_num_relocations ();
8a8cfb
 
8a8cfb
-  /* No other flag than DL_LOOKUP_ADD_DEPENDENCY or DL_LOOKUP_GSCOPE_LOCK
8a8cfb
-     is allowed if we look up a versioned symbol.  */
8a8cfb
-  assert (version == NULL
8a8cfb
-	  || (flags & ~(DL_LOOKUP_ADD_DEPENDENCY | DL_LOOKUP_GSCOPE_LOCK))
8a8cfb
-	     == 0);
8a8cfb
+  /* DL_LOOKUP_RETURN_NEWEST does not make sense for versioned
8a8cfb
+     lookups.  */
8a8cfb
+  assert (version == NULL || !(flags & DL_LOOKUP_RETURN_NEWEST));
8a8cfb
 
8a8cfb
   size_t i = 0;
8a8cfb
   if (__glibc_unlikely (skip_map != NULL))