From owner-freebsd-hackers Sat Aug 4 15:40:49 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by hub.freebsd.org (Postfix) with ESMTP id 668F137B401 for ; Sat, 4 Aug 2001 15:40:45 -0700 (PDT) (envelope-from ticso@mail.cicely.de) Received: from mail.cicely.de (cicely20 [10.1.1.22]) by srv1.cosmo-project.de (8.11.0/8.11.0) with ESMTP id f74MecV59602 for ; Sun, 5 Aug 2001 00:40:40 +0200 (CEST) Received: (from ticso@localhost) by mail.cicely.de (8.11.0/8.11.0) id f74Meen08051; Sun, 5 Aug 2001 00:40:40 +0200 (CEST) Date: Sun, 5 Aug 2001 00:40:39 +0200 From: Bernd Walter To: freebsd-hackers@FreeBSD.ORG Cc: Bernd Walter Subject: Re: linking WITH -lstdc++ makes executeables smaller? Message-ID: <20010805004039.B7991@cicely20.cicely.de> References: <20010803141225.A3246@cicely20.cicely.de> <20010804145834.A1138@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010804145834.A1138@dragon.nuxi.com>; from dev-null@NUXI.com on Sat, Aug 04, 2001 at 02:58:34PM -0700 X-Operating-System: NetBSD cicely20.cicely.de 1.5 sparc Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Aug 04, 2001 at 02:58:34PM -0700, David O'Brien wrote: > On Fri, Aug 03, 2001 at 02:12:25PM +0200, Bernd Walter wrote: > > I used a library which also needed -lstdc++. > > Now that I did not need them any more I removed them and was > > surprised that the resulting FreeBSD binary actually got bigger! > > On NetBSD the binary is slightly smaller as expected. > > > > Is there any logical explanation for this phaenomen? > > Forget `ls'. Show the output from `size' and `file'. With -lstdc++: ticso@cicely8> size cbckd text data bss dec hex filename 45284 3572 5088 53944 d2b8 cbckd ticso@cicely8> file cbckd cbckd: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked (uses shared libs), not stripped Without -lstdc++: ticso@cicely8> size cbckd text data bss dec hex filename 62414 4208 5304 71926 118f6 cbckd ticso@cicely8> file cbckd cbckd: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked (uses shared libs), not stripped Same on alpha: With -lstdc++: ticso@cicely9> size cbckd text data bss dec hex filename 61268 5876 9280 76424 12a88 cbckd ticso@cicely9> file cbckd cbckd: ELF 64-bit LSB executable, Alpha (unofficial), version 1 (FreeBSD), dynamically linked (uses shared libs), not stripped Without -lstdc++: ticso@cicely9> size cbckd text data bss dec hex filename 91177 8024 9712 108913 1a971 cbckd ticso@cicely9> file cbckd cbckd: ELF 64-bit LSB executable, Alpha (unofficial), version 1 (FreeBSD), dynamically linked (uses shared libs), not stripped -- B.Walter COSMO-Project http://www.cosmo-project.de ticso@cicely.de Usergroup info@cosmo-project.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message