From owner-freebsd-questions Thu Aug 1 0:29: 5 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A01C337B400 for ; Thu, 1 Aug 2002 00:29:01 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id BFAAD43E4A for ; Thu, 1 Aug 2002 00:29:00 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk ([IPv6:::1]) by smtp.infracaninophile.co.uk (8.12.5/8.12.5) with ESMTP id g717SxdG065595; Thu, 1 Aug 2002 08:28:59 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost) by happy-idiot-talk.infracaninophile.co.uk (8.12.5/8.12.5/Submit) id g717SsRe065594; Thu, 1 Aug 2002 08:28:54 +0100 (BST) Date: Thu, 1 Aug 2002 08:28:54 +0100 From: Matthew Seaman To: Darren Pilgrim Cc: freebsd-questions@FreeBSD.ORG Subject: Re: How to tell if something is built static- or dynamic-linked? Message-ID: <20020801072854.GB41777@happy-idiot-talk.infracaninophi> References: <3D4856F0.3773D429@pantherdragon.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D4856F0.3773D429@pantherdragon.org> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Jul 31, 2002 at 02:30:24PM -0700, Darren Pilgrim wrote: > The OpenSSL bug has triggered me to learn how to figure out if a given > program was built with static- or dynamic-linking? I figure there's > something in the Makefile, but what? Virtually everything is built using dynamic linking --- the exceptions being some absolutely crucial commands found in /sbin or /bin. You can use the file(1) command to see the difference: happy-idiot-talk:~:% file /bin/sh /bin/sh: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), statically linked, stripped happy-idiot-talk:~:% file /usr/bin/sed /usr/bin/sed: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked (uses shared libs), stripped Use the ldd(1) command to see what shared libraries are linked to by a dynamic executable: happy-idiot-talk:~:% ldd /usr/bin/sed /usr/bin/sed: libc.so.4 => /usr/lib/libc.so.4 (0x2806b000) If you've installed a version of the openssl port, you can run: pkg_info -R openssl\* to find the ports that depend on the openssl port, but that's not guarranteed be either complete or accurate. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way Tel: +44 1628 476614 Marlow Fax: +44 0870 0522645 Bucks., SL7 1TH UK To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message