bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gprof cannot find symbols in a MIPS IRIX a.out


From: Ian Lance Taylor
Subject: Re: gprof cannot find symbols in a MIPS IRIX a.out
Date: 21 Dec 2003 08:10:05 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Anmol Paralkar <address@hidden> writes:

>  I am trying to use gprof on a MIPS IRIX 6.5 box, but gprof seems to be unable
>  to read in the symbols of the executable.

gprof uses the normal symbol table, not the dynamic symbol table.

An executable which uses shared libraries will still normally have a
normal symbol table, unless you intentionally stripped it for some
reason.

>  Doing an:
> 
>  elfdump -Dt a.out
> 
>  does indicate the presence of symbols:
> 
> [58]     0x10001000         232      FUNC    GLOBAL   DEFAULT  UNDEF    atexit
> [59]     0x10001014         0        FUNC    GLOBAL   DEFAULT  UNDEF    profil
> [60]     0x1000114c         112      FUNC    GLOBAL   DEFAULT  MIPSTEXT main
> [61]     0x100011c0         724      FUNC    GLOBAL   DEFAULT  MIPSTEXT 
> monstartup
> [62]     0x10001498         604      FUNC    GLOBAL   DEFAULT  MIPSTEXT 
> _mcleanup
> [63]     0x100016f8         808      FUNC    GLOBAL   DEFAULT  MIPSTEXT mcount
> 
>  (Or doing a 'objdump -T a.out' also indicates the same).

That isn't very many symbols.  Are you trying to use gprof to profile
the functions in the shared library?  That won't work unless the
library itself was compiled with -pg.  Even then it probably requires
support from the shared library, which probably won't happen on an
Irix system.

>  Do I need to specify some option to gprof so that it can read the dynamic 
> symbol
>  table of executables that use shared libraries or is there no way gprof will 
> work
>  when using shared libraries.

gprof does normally work when using shared libraries, but it normally
only profiles the functions in the main executable.

>  I also tried making this change in core_init() in gprof/corefile.c:

...

>  But that does not work either.

Precisely how does it not work?  I don't know if that will give you
correct profiling, but I would not expect you to get the ``no symbol''
error.

Ian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]