This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Anmol Paralkar <aparalka@cisco.com> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]