From owner-freebsd-current@FreeBSD.ORG Wed Jan 4 22:41:25 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70BA6106567A for ; Wed, 4 Jan 2012 22:41:25 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 32CFB8FC1B for ; Wed, 4 Jan 2012 22:41:25 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id EF2E77300A; Wed, 4 Jan 2012 23:58:15 +0100 (CET) Date: Wed, 4 Jan 2012 23:58:15 +0100 From: Luigi Rizzo To: Garrett Cooper Message-ID: <20120104225815.GA73964@onelab2.iet.unipi.it> References: <20120104222315.GA73613@onelab2.iet.unipi.it> <20120104222955.GA73868@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: current@freebsd.org Subject: Re: add 'ldd' to cross-tools ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 22:41:25 -0000 On Wed, Jan 04, 2012 at 02:30:27PM -0800, Garrett Cooper wrote: > On Wed, Jan 4, 2012 at 2:29 PM, Luigi Rizzo wrote: ... > >> $ objdump -x `which tar` | awk '$1 == "NEEDED" { print $2 }' > >> libarchive.so.5 > >> libbz2.so.4 > >> libz.so.6 > >> liblzma.so.5 > >> libbsdxml.so.4 > >> libcrypto.so.6 > >> libc.so.7 > > > > wonderful, thanks! > > Np! The only gap with both of these tools is that you have to > watch out for dl_open'ed binaries as they won't show up in ldd/objdump > -x. If I could figure out how to detect these with a command line > tool, I would be set for life :). and the other thing, i just realized, is that once you locate the libraries you should run objdump recursively to find out further dependencies. Perhaps ldd sorts this out by itself ? cheers luigi