This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

gprof cannot find symbols in a MIPS IRIX a.out


Hi,

 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.

 On a:

 $ gprof a.out gmon.out

 I get the following error message:

 gprof: file `a.out' has no symbols

 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).

 I tried compiling with -non_shared specified but the link fails owing to
 /usr/lib32/nonshared/crt1.o not being present on my box. (Using native cc).

 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.

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

--------------------------------------------------------------------------------
  /* This will probably give us more than we need, but that's ok.  */
  core_num_syms = bfd_get_dynamic_symtab_upper_bound (core_bfd); <<<<<<<<<<<<<<<<
  if (core_num_syms < 0)
    {
      fprintf (stderr, "%s: %s: %s\n", whoami, aout_name,
               bfd_errmsg (bfd_get_error ()));
      done (1);
    }

  core_syms = (asymbol **) xmalloc (core_num_syms);
  core_num_syms = bfd_canonicalize_dynamic_symtab (core_bfd, core_syms); <<<<<<<<<<<<<<<<

  if (core_num_syms < 0)
    {
      fprintf (stderr, "%s: %s: %s\n", whoami, aout_name,
               bfd_errmsg (bfd_get_error ()));
      done (1);
    }
--------------------------------------------------------------------------------

 But that does not work either. Do I need to do something else too (or is this not right)?
 (But slurp_dynamic_symtab() in binutils/objdump.c looks the same too).

 Any help would be greatly appreciated.

Thanks & Regards,
Anmol.


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