This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gprof cannot find symbols in a MIPS IRIX a.out
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Anmol Paralkar <aparalka at cisco dot com>
- Cc: bug-binutils at gnu dot org, binutils at sources dot redhat dot com, gcc at gcc dot gnu dot org
- Date: 21 Dec 2003 08:10:05 -0500
- Subject: Re: gprof cannot find symbols in a MIPS IRIX a.out
- References: <Pine.GSO.4.58.0312211027390.10897@codc1-xdm1.cisco.com>
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