Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jun 2010 22:04:52 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209544 - head/libexec/rtld-elf
Message-ID:  <201006262204.o5QM4qLD083139@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Sat Jun 26 22:04:52 2010
New Revision: 209544
URL: http://svn.freebsd.org/changeset/base/209544

Log:
  Ignore versioned dependencies on shared objects to which we do not link.
  This fixes an error with files like this created by GNU ld under certain
  circumstances.

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Sat Jun 26 21:44:45 2010	(r209543)
+++ head/libexec/rtld-elf/rtld.c	Sat Jun 26 22:04:52 2010	(r209544)
@@ -3443,9 +3443,13 @@ locate_dependency(const Obj_Entry *obj, 
 	if (object_match_name(needed->obj, name))
 	    return needed->obj;
     }
-    _rtld_error("%s: Unexpected inconsistency: dependency %s not found",
-	obj->path, name);
-    die();
+
+    /*
+     * 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;
 }
 
 static int
@@ -3567,6 +3571,9 @@ rtld_verify_object_versions(Obj_Entry *o
     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))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006262204.o5QM4qLD083139>