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