From owner-freebsd-questions@FreeBSD.ORG Thu Jul 12 22:52:26 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 01CB5106566B for ; Thu, 12 Jul 2012 22:52:26 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id A976E8FC16 for ; Thu, 12 Jul 2012 22:52:25 +0000 (UTC) Received: from ncsc.bris.ac.uk ([137.222.10.41]) by dirg.bris.ac.uk with esmtp (Exim 4.72) (envelope-from ) id 1SpSF9-0001gj-9B for freebsd-questions@freebsd.org; Thu, 12 Jul 2012 23:52:19 +0100 Received: from mech-cluster241.men.bris.ac.uk ([137.222.187.241]) by ncsc.bris.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1SpSF8-0007RD-S1 for freebsd-questions@freebsd.org; Thu, 12 Jul 2012 23:52:19 +0100 Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.5/8.14.5) with ESMTP id q6CMqIOR069030 for ; Thu, 12 Jul 2012 23:52:18 +0100 (BST) (envelope-from mexas@bris.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.5/8.14.5/Submit) id q6CMqIb8069029 for freebsd-questions@freebsd.org; Thu, 12 Jul 2012 23:52:18 +0100 (BST) (envelope-from mexas@bris.ac.uk) X-Authentication-Warning: mech-cluster241.men.bris.ac.uk: mexas set sender to mexas@bris.ac.uk using -f Date: Thu, 12 Jul 2012 23:52:18 +0100 From: Anton Shterenlikht To: freebsd-questions@freebsd.org Message-ID: <20120712225218.GA69013@mech-cluster241.men.bris.ac.uk> Mail-Followup-To: freebsd-questions@freebsd.org References: <20120712223130.GA58047@mech-cluster241.men.bris.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120712223130.GA58047@mech-cluster241.men.bris.ac.uk> User-Agent: Mutt/1.4.2.3i Subject: Re: profiling library smaller than non-profiling, while it contains more symbols. Why? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 22:52:26 -0000 On Thu, Jul 12, 2012 at 11:31:31PM +0100, Anton Shterenlikht wrote: > While updating my port (math/slatec) to use > the new OPTIONS framework, I did some > experiments with the profiling library. > > I don't know much about this, so what surprised me > is that the profiling library is smaller: > > # ls -al lib*a > -rw-r--r-- 1 root wheel 6582354 Jul 12 22:56 libslatec.a > -rw-r--r-- 1 root wheel 6555122 Jul 12 23:02 libslatec_p.a > # > > while it adds .mcount symbol to each object file: > > # nm libslatec.a > nm > # nm libslatec_p.a > nmp > # wc nm nmp > 16436 36675 373033 nm > 17885 39573 413605 nmp > 34321 76248 786638 total > # grep -c mcount nmp > 1449 > # expr 16436 + 1449 > 17885 > # > > Using diff I can confirm that the only difference > between the 2 libs is the .mcount symbol for > each object file in the profiling library. > > So how can the profiling library be smaller? > Also, the library compiled on amd64 has lots more symbols than if compiled on ia64. For example: amd64: zbesy.o: 0000000000000000 r .LC0 0000000000000008 r .LC1 0000000000000010 r .LC11 0000000000000020 r .LC12 0000000000000028 r .LC13 0000000000000030 r .LC14 0000000000000010 r .LC2 0000000000000018 r .LC5 0000000000000000 r .LC6 U cos U d1mach_ U exp U i1mach_ U sin U zbesh_ 0000000000000000 T zbesy_ and ia64: zbesy.o: U cos U d1mach_ U exp U i1mach_ U sin U zbesh_ 0000000000000000 T zbesy_ Why the difference? -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 331 5944 Fax: +44 (0)117 929 4423