Re: ldd broken for profiling binaries?

From: Alexander Kabaev <kabaev_at_gmail.com>
Date: Mon, 28 May 2007 18:53:18 -0400
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:
> 
> ,-----------------------------------------------------------------------
> | $ cat -n foo.c
> |      1  #include <stdio.h>
> |      2  
> |      3  int
> |      4  main(void)
> |      5  {
> |      6          int k;
> |      7  
> |      8          for (k = 0; k < 10000; k++)
> |      9                  printf("Hello world\n");
> |     10          return 0;
> |     11  }
> | $ DEBUG_FLAGS='-pg' ; CFLAGS='' ; export DEBUG_FLAGS CFLAGS
> | $ make cleandir
> | rm -f foo foo.o
> | rm -f .depend GPATH GRTAGS GSYMS GTAGS
> | $ make cleandir
> | rm -f foo foo.o
> | rm -f .depend GPATH GRTAGS GSYMS GTAGS
> | $ make
> | Warning: Object directory not changed from original /tmp/foo
> | cc  -pg  -c foo.c
> | 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.

-- 
Alexander Kabaev

Received on Mon May 28 2007 - 20:53:35 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:11 UTC