ldd broken for profiling binaries?
Giorgos Keramidas
keramida at ceid.upatras.gr
Thu May 31 00:29:08 UTC 2007
On 2007-05-28 18:53, Alexander Kabaev <kabaev at gmail.com> wrote:
> On Mon, 28 May 2007 21:18:57 +0300
> Giorgos Keramidas <keramida at 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]
:-)
More information about the freebsd-current
mailing list