Revert r209544. It papers over a binutils bug, and is not even a reliable

fix for it.

The bug occurs when using the --as-needed flag to ld in the presence of
synthetic linker-generated symbols that reference symbols defined in
linked-to shared libraries with versioned symbols. When the only symbols
used from a library fall into this category, ld will drop the DT_NEEDED
entry for it, but retain the versioning information. This bug is best
fixed/hacked around in binutils, not in rtld.

Discussed with:	kan
This commit is contained in:
Nathan Whitehorn 2010-06-28 01:40:56 +00:00
parent 16596b221d
commit 153d788f31
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=209558

View File

@ -3443,13 +3443,9 @@ locate_dependency(const Obj_Entry *obj, const char *name)
if (object_match_name(needed->obj, name))
return needed->obj;
}
/*
* GNU LD sometimes refers to version dependencies on objects to which
* it does not actually link. Treat this as a non-fatal error, and
* ignore this dependency.
*/
return NULL;
_rtld_error("%s: Unexpected inconsistency: dependency %s not found",
obj->path, name);
die();
}
static int
@ -3571,9 +3567,6 @@ rtld_verify_object_versions(Obj_Entry *obj)
vn = obj->verneed;
while (vn != NULL) {
depobj = locate_dependency(obj, obj->strtab + vn->vn_file);
if (depobj == NULL)
break;
vna = (const Elf_Vernaux *) ((char *)vn + vn->vn_aux);
for (;;) {
if (check_object_provided_version(obj, depobj, vna))