profiling library smaller than non-profiling, while it contains more symbols. Why?

Anton Shterenlikht mexas at bristol.ac.uk
Thu Jul 12 22:31:40 UTC 2012


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?

-- 
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


More information about the freebsd-questions mailing list