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