Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 May 2007 03:27:23 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Alexander Kabaev <kabaev@gmail.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: ldd broken for profiling binaries?
Message-ID:  <20070531002722.GA3985@kobe.laptop>
In-Reply-To: <20070528185318.1154742e@kan.dnsalias.net>
References:  <20070528181856.GA81757@kobe.laptop> <20070528185318.1154742e@kan.dnsalias.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2007-05-28 18:53, Alexander Kabaev <kabaev@gmail.com> wrote:
> On Mon, 28 May 2007 21:18:57 +0300
> Giorgos Keramidas <keramida@freebsd.org> wrote:
> > ldd seems to be broken for profiling binaries, and the profiling
> > binaries built with gcc42 seem to be unusable here:
> > [...]
> > | cc  -pg   -o foo foo.o
> > | $ ./foo
> > | /libexec/ld-elf.so.1: ./foo: Unexpected  inconsistency: dependency
> > libgcc_s.so.1 not found | $ ldd foo
> > | foo:
> > | /libexec/ld-elf.so.1: foo: Unexpected  inconsistency: dependency
> > libgcc_s.so.1 not found | foo: exit status 1
> > | $
> > `-----------------------------------------------------------------------
> 
> linker pulled in libgcc_s.so.1 symbols, but somehow managed not to
> record dependency on lib. This might be a bug in binutils, but someone
> needs to look close to be sure.
> 
> I think I'll disable shared libgcc for profiled builds for now.

Thanks.  It seems to work for now :)

$ file foo
foo: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), statically linked, not stripped
$ gprof foo foo.gmon
[...]
                                  called/total       parents 
index  %time    self descendents  called+self    name           index
                                  called/total       children

                0.06        9.68       1/1           _start [2]
[1]    100.0    0.06        9.68       1         main [1]
                0.00        8.80 1000000/1000000     bar [8]
                0.00        0.88  100000/100000      foo [9]

:-)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070531002722.GA3985>