From chdscni9@ddba034.netstream.ch  Thu Aug 10 16:47:43 2006
Return-Path: <chdscni9@ddba034.netstream.ch>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1FB3816A4DD
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 10 Aug 2006 16:47:43 +0000 (UTC)
	(envelope-from chdscni9@ddba034.netstream.ch)
Received: from ddba034.netstream.ch (ddba034.netstream.ch [62.65.128.34])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 84DF643D46
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 10 Aug 2006 16:47:42 +0000 (GMT)
	(envelope-from chdscni9@ddba034.netstream.ch)
Received: from ddba034.netstream.ch (localhost.netstream.ch [127.0.0.1])
	by ddba034.netstream.ch (8.13.6/8.13.6) with ESMTP id k7AGlCGH029758;
	Thu, 10 Aug 2006 18:47:12 +0200 (CEST)
	(envelope-from chdscni9@ddba034.netstream.ch)
Received: (from chdscni9@localhost)
	by ddba034.netstream.ch (8.13.6/8.13.6/Submit) id k7AGlBPM029757;
	Thu, 10 Aug 2006 18:47:11 +0200 (CEST)
	(envelope-from chdscni9)
Message-Id: <200608101647.k7AGlBPM029757@ddba034.netstream.ch>
Date: Thu, 10 Aug 2006 18:47:11 +0200 (CEST)
From: Nico Schottelius <chdscni9@ddba034.netstream.ch>
Reply-To: Nico Schottelius <nico-freebsd@schottelius.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: nico-freebsd@schottelius.org
Subject: ldd is unable to read ELF header?
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         101765
>Category:       bin
>Synopsis:       ldd(1) is unable to read ELF header?
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 10 16:50:16 GMT 2006
>Closed-Date:    Mon Jun 23 14:30:43 UTC 2008
>Last-Modified:  Mon Jun 23 14:30:43 UTC 2008
>Originator:     Nico Schottelius
>Release:        FreeBSD 5.5-RELEASE amd64
>Organization:
Netstream AG
>Environment:
System: FreeBSD ddba034.netstream.ch 5.5-RELEASE FreeBSD 5.5-RELEASE #0: Fri Jul 7 13:21:21 CEST 2006 root@adsltvmaster.netstream.ch:/usr/src/sys/amd64/compile/NSKERNEL amd64

It is a AMD64 system. Perhaps this makes a difference.
>Description:
ldd is not able to show dependencies, although file is a dynamic executable.

>How-To-Repeat:
Use ldd on a dynamic executable:

root@ddba034:/usr/local/netvault/bin > file txtconfig 
txtconfig: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for FreeBSD 5.4, dynamically linked (uses shared libs), stripped
root@ddba034:/usr/local/netvault/bin > ldd txtconfig 
ldd: txtconfig: can't read program header
ldd: txtconfig: not a dynamic executable

Reading the elf header with readelf is possible.

>Fix:
>Release-Note:
>Audit-Trail:

From: Pav Lucistnik <pav@FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/101765: ldd is unable to read ELF header?
Date: Mon, 28 Aug 2006 10:20:00 +0200

 Known limitation. You can circumvent this by doing:
 
 LD_32_TRACE_LOADED_OBJECTS=1 /usr/local/netvault/bin
 
 ldd have to be taught to set up LD_32_* variables for 32-bit binaries in
 64-bit environment...
 
 -- 
 Pav Lucistnik <pav@oook.cz>
               <pav@FreeBSD.org>
 
 What luck - a dagger!  This is your holder.  Rest there and let me die.
State-Changed-From-To: open->closed 
State-Changed-By: edwin 
State-Changed-When: Mon Jun 23 14:29:29 UTC 2008 
State-Changed-Why:  
A patch can be found in  bin/124906. 

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