bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: gprof can't find .text symbols on elf32-bigmips files


From: Nick Clifton
Subject: Re: gprof can't find .text symbols on elf32-bigmips files
Date: 18 Dec 2001 10:27:59 +0000
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1

Hi Uros,

> I am using gprof out of binutils-2.11.2 to process ELF files generated
> by a NetBSD cross-compiler (cross-gcc is egcs-2.91.60, cross-ld 2.9.1).
> Gprof can't seem to find a large number of .text symbols.  It turns out
> that binutils elf32-bigmips backend reports text addresses as absolute
> (Aa) instead of text (Tt), which causes gprof symbol filtering to
> discard most of them.

This does not appear to be a problem with the current sources.  You
did not include a test case with your bug report, so I tried to invent
one:

                .text
                .global global_text
        global_text:
        local_text:

                .global global_abs
        global_abs = 0
        local_abs = 0

                .data
                .global global_data
        global_data:
        local_data:

And when assembled and then run through nm I get this output:

        00000000 A global_abs
        00000000 D global_data
        00000000 T global_text
        00000000 a local_abs
        00000000 d local_data
        00000000 t local_text

Which looks correct to me.

> The following patch maps absolute symbols into text addresses to work
> around this problem.  I don't know whether this is the correct thing to
> do.

> +  /* XXX for some reason mips-elf reports text symbols as absolute values.
> +   * Map absolute types into text and let them be filtered out later */
> +  if (i == 'A' || i == 'a')
> +      i += 'T' - 'A';

Thanks for the patch.  I am not going to apply it though, since it is
MIPS specific and only covers up a bug that appears to have already
been fixed.

Cheers
        Nick




reply via email to

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