[3/4] elf: Support version-less lookup in _dl_lookup_direct
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
Commit Message
---
elf/dl-lookup-direct.c | 5 +++++
sysdeps/generic/ldsodefs.h | 7 ++++---
2 files changed, 9 insertions(+), 3 deletions(-)
@@ -54,6 +54,11 @@ check_match (const struct link_map *const map, const char *const undef_name,
/* Not the symbol we are looking for. */
return NULL;
+ if (map->l_versyms == NULL || version == NULL)
+ /* No symbol versioning information available, or no symbol
+ version requested. Accepted the symbol. */
+ return sym;
+
ElfW(Half) ndx = map->l_versyms[symidx] & 0x7fff;
if (map->l_versions[ndx].hash != version_hash
|| strcmp (map->l_versions[ndx].name, version) != 0)
@@ -1051,9 +1051,10 @@ extern lookup_t _dl_lookup_symbol_x (const char *undef,
MAP) for the symbol UNDEF_NAME, with GNU hash NEW_HASH (computed
with dl_new_hash), symbol version VERSION, and symbol version hash
VERSION_HASH (computed with _dl_elf_hash). Returns a pointer to
- the symbol table entry in MAP on success, or NULL on failure. MAP
- must have symbol versioning information, or otherwise the result is
- undefined. */
+ the symbol table entry in MAP on success, or NULL on failure.
+
+ If VERSION is NULL or MAP does not have symbol versioning
+ information, any symbol version is accepted. */
const ElfW(Sym) *_dl_lookup_direct (struct link_map *map,
const char *undef_name,
uint32_t new_hash,