This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[review v2] Clarify purpose of assert in _dl_lookup_symbol_x
- From: "Florian Weimer (Code Review)" <gerrit at gnutoolchain-gerrit dot osci dot io>
- To: Florian Weimer <fweimer at redhat dot com>, "Gabriel F. T. Gomes" <gabriel at inconstante dot net dot br>, libc-alpha at sourceware dot org
- Date: Tue, 12 Nov 2019 07:51:16 -0500
- Subject: [review v2] Clarify purpose of assert in _dl_lookup_symbol_x
- Auto-submitted: auto-generated
- References: <gerrit.1572549639000.I3384349cef90cfd91862ebc34a4053f0c0a99404@gnutoolchain-gerrit.osci.io>
- Reply-to: fweimer at redhat dot com, gabriel at inconstante dot net dot br, fweimer at redhat dot com, libc-alpha at sourceware dot org
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