From markd@osprey.grizzly.com  Tue Oct 22 20:03:37 1996
Received: from scruz.net (nic.scruz.net [165.227.1.2])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id UAA25706
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 22 Oct 1996 20:03:36 -0700 (PDT)
Received: from osprey.grizzly.com by scruz.net (8.7.3/1.34)
	id UAA00389; Tue, 22 Oct 1996 20:03:33 -0700 (PDT)
Received: (from markd@localhost) by osprey.grizzly.com (8.7.6/8.7.3) id UAA00605; Tue, 22 Oct 1996 20:04:07 -0700 (PDT)
Message-Id: <199610230304.UAA00605@osprey.grizzly.com>
Date: Tue, 22 Oct 1996 20:04:07 -0700 (PDT)
From: Mark Diekhans <markd@Grizzly.COM>
Reply-To: markd@Grizzly.COM
To: FreeBSD-gnats-submit@freebsd.org
Subject: ldd/ld.so don't print out missing libraries.
X-Send-Pr-Version: 3.2

>Number:         1869
>Category:       bin
>Synopsis:       ldd/ld.so don't print out missing libraries.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    jdp
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 22 20:10:02 PDT 1996
>Closed-Date:    Thu Oct 24 09:24:53 PDT 1996
>Last-Modified:  Thu Oct 24 09:26:05 PDT 1996
>Originator:     Mark Diekhans
>Release:        FreeBSD 2.2-961014-SNAP i386
>Organization:
== Mark Diekhans <markd@grizzly.com> ==
>Environment:

        2.2-961014-SNAP

>Description:

        ldd on a program with unresolved shared libraries doesn't report the
        names of the missing shared libraries.  Running such a program produces
        the error 'ld.so failed', but doesn't say why.

>How-To-Repeat:



>Fix:
	


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: jdp 
State-Changed-When: Tue Oct 22 22:02:19 PDT 1996 
State-Changed-Why:  
I need some feedback on this problem. 

I tested this on a recent -current system (from 19 October 1996), and it 
works OK.  I am not aware of its having been broken at any time recently. 
The symptoms sound like what used to happen around 2.0.5 and possibly 
even 2.1.0, but the problem was fixed since then.  Part of the fix was 
in crt0.o, which is linked into the executable.  If you are running an 
old executable, even under -current, you will see this symptom. 

Could you please confirm whether you're running a pre-2.1.5 executable 
when you see this problem?  And/or describe a specific test case so that 
I can try to duplicate the problem. 


Responsible-Changed-From-To: freebsd-bugs->jdp 
Responsible-Changed-By: jdp 
Responsible-Changed-When: Tue Oct 22 22:02:19 PDT 1996 
Responsible-Changed-Why:  
Fixed this problem around 2.0.5 or 2.1.0. 

From: Peter Wemm <peter@spinner.DIALix.COM>
To: John Polstra <jdp@freefall.freebsd.org>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/1869 
Date: Wed, 23 Oct 1996 14:15:01 +0800

 John Polstra wrote:
 > Synopsis: ldd/ld.so don't print out missing libraries.
 > I tested this on a recent -current system (from 19 October 1996), and it
 > works OK.  I am not aware of its having been broken at any time recently.
 > The symptoms sound like what used to happen around 2.0.5 and possibly
 > even 2.1.0, but the problem was fixed since then.  Part of the fix was
 > in crt0.o, which is linked into the executable.  If you are running an
 > old executable, even under -current, you will see this symptom.
 
 There is also a possibility that something didn't quite work out right in 
 the crt.o <-> ld.so interface change that was done recently.
 
 In particular, the variables are the version of crt0.o compiled in the 
 executable, and the version of /usr/libexec/ld.so
 
 crt0.o calls ld.so with an interface of "version 4" first, and if the 
 /usr/libexec/ld.so is too old, it is supposed to fall back to trying again 
 with version 3.  It's similar with a version 3 crt0.o calling a v4 ld.so, 
 the v4 ld.so is supposed to use the older interface when called by an old 
 crt0.o.
 
 I tested this on two of my machines with deliberately different versions 
 of the various components, I'm pretty sure all cases are covered, but I 
 may have missed something or otherwise botched it after testing.
 
 Cheers,
 -Peter
 
 
State-Changed-From-To: feedback->analyzed 
State-Changed-By: jdp 
State-Changed-When: Wed Oct 23 08:29:07 PDT 1996 
State-Changed-Why:  
The submitter has confirmed that this failure occurs only for old 
executables (created prior to 2.1.0). 

It is possible that we could move the printing of the error message from 
crt0.o into ld.so.  That would solve the problem even for old binaries. 
I will look into the feasibility of doing that, before closing this PR. 

From: John Polstra <jdp@polstra.com>
To: Peter Wemm <peter@spinner.DIALix.COM>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/1869 
Date: Wed, 23 Oct 1996 08:25:33 -0700

 Peter Wemm wrote:
 > There is also a possibility that something didn't quite work out
 > right in the crt.o <-> ld.so interface change that was done recently.
 ...
 > I tested this on two of my machines with deliberately different
 > versions of the various components, I'm pretty sure all cases are
 > covered, but I may have missed something or otherwise botched it
 > after testing.
 
 Mark Diekhans, the submitter of the PR, has confirmed that the problem
 only happens on old executables.  The bug does not exist for binaries
 created and executed on 2.1.0 or later versions of FreeBSD.
 
 All the same, I'm going to think about the possibility of making ld.so
 print out the error message directly, rather than relying on crt0 to
 print it out.  That would make it work even on old executables.
 
 John
State-Changed-From-To: analyzed->closed 
State-Changed-By: jdp 
State-Changed-When: Thu Oct 24 09:24:53 PDT 1996 
State-Changed-Why:  
Fixed in version 1.40 of "src/gnu/usr.bin/ld/rtld/rtld.c". 
>Unformatted:
