From edwin@mavetju.org  Sat Sep  6 20:45:01 2003
Return-Path: <edwin@mavetju.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id EDB8716A4BF
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  6 Sep 2003 20:45:01 -0700 (PDT)
Received: from mag.barnet.com.au (mag.barnet.com.au [218.185.88.3])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9C8A843FE5
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  6 Sep 2003 20:45:00 -0700 (PDT)
	(envelope-from edwin@mavetju.org)
Received: from extmail.barnet.com.au (tim.direct.int.barnet.com.au [10.10.10.2])
	by mag.barnet.com.au (Postfix) with ESMTP id 06BD44834
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Sep 2003 13:44:56 +1000 (EST)
Received: from k7.mavetju (tim.barnet.com.au [218.185.88.1])
	by extmail.barnet.com.au (Postfix) with ESMTP id AC7A91E10
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Sep 2003 13:44:54 +1000 (EST)
Received: by k7.mavetju (Postfix, from userid 1001)
	id B15CE6A7101; Sun,  7 Sep 2003 13:44:53 +1000 (EST)
Message-Id: <20030907034453.B15CE6A7101@k7.mavetju>
Date: Sun,  7 Sep 2003 13:44:53 +1000 (EST)
From: Edwin Groothuis <edwin@mavetju.org>
Reply-To: Edwin Groothuis <edwin@mavetju.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] rtld.c - give more info on missing shared libraries
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         56549
>Category:       bin
>Synopsis:       [patch] rtld.c - give more info on missing shared libraries
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    eik
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 06 20:50:12 PDT 2003
>Closed-Date:    Fri Jun 11 09:08:08 GMT 2004
>Last-Modified:  Fri Jun 11 09:08:08 GMT 2004
>Originator:     Edwin Groothuis
>Release:        FreeBSD 4.8-RELEASE i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju 4.8-RELEASE FreeBSD 4.8-RELEASE #0: Sun Aug 17 16:04:25 EST 2003 edwin@k7.mavetju:/usr/src/sys/compile/k7 i386

>Description:

When you try to start a program with a missing library, this is the
error message you get:

    /usr/libexec/ld-elf.so.1: Shared object "libintl.so.4" not found

You can find out that it is missing by using ldd (and exactly which
other library it requires by running ldd with the patch in bin/37448).

But yes, life could be so much nicer if it would tell you who was
missing it:

    /usr/libexec/ld-elf.so.1: Shared object "libintl.so.4" not found, needed by "/usr/X11R6/lib/libgnomemm-1.2.so.10"

At least I know I have to fight with libgnomemm instead of with the
original program.

>How-To-Repeat:

See above

>Fix:

--- rtld.c?rev=1.87	Sun Aug 17 18:06:00 2003
+++ rtld.c	Sun Sep  7 13:36:02 2003
@@ -839,7 +839,11 @@
       (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL)
 	return pathname;
 
-    _rtld_error("Shared object \"%s\" not found", name);
+    if (refobj != NULL)
+	_rtld_error("Shared object \"%s\" not found, needed by \"%s\"", name, refobj->path);
+    else
+	_rtld_error("Shared object \"%s\" not found", name);
+
     return NULL;
 }
 
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: eik 
State-Changed-When: Fri May 28 02:06:03 CEST 2004 
State-Changed-Why:  
awaiting MFC 


Responsible-Changed-From-To: freebsd-bugs->eik 
Responsible-Changed-By: eik 
Responsible-Changed-When: Fri May 28 02:06:03 CEST 2004 
Responsible-Changed-Why:  
Committed to -CURRENT 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56549 
State-Changed-From-To: patched->closed 
State-Changed-By: eik 
State-Changed-When: Fri Jun 11 11:07:41 CEST 2004 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56549 
>Unformatted:
