Wrong address for static function in linux module

Jean-Rene Peulve jr.peulve@wanadoo.fr
Tue Apr 11 14:41:00 GMT 2006


Hi Daniel,

At 15:38 11/04/06, Daniel Jacobowitz wrote:
>On Tue, Apr 11, 2006 at 03:33:32PM +0200, Jean-Rene Peulve wrote:
> > Relocation section '.rela.stab' at offset 0x2039c contains 41 entries:
> >  Offset     Info    Type            Sym.Value  Sym. Name + Addend
>
>...
>
> > 000032e4  00000201 R_68K_32          00000000   .text + 136
>
> > Output of m68k-elf-readelf -s horloge.o:
> > Symbol table '.symtab' contains 47 entries:
> > ..
> >  12: 00000136    62 FUNC    LOCAL  DEFAULT    1 horloge_read
>
>There's your relocation of debug info.
>
>It is entirely likely that the problem only happens because you're
>using stabs.  It's supposed to work, but I've never tried it.  Try
>taking a look at the contents of the .stab section at that offset
>(0x32e4) in the file.  Then breakpoint after the call to
>symfile_relocate_debug_section in elfstab_build_psymtabs, and see
>what's at offset 0x32e4 now.  It should be a bit relocated.

In bfd_perform_relocation for the .stab section I see that at line 633
relocation is 0 for the static function horloge_read when it is 0x37a for
the non static function HorlogeCheck.
I guess that the .stab section is wrong for static function as seen in
the readelf -r output. Only the non static have values != 0.

What do you recommend to use rather than stabs ?
Jean-René




>--
>Daniel Jacobowitz
>CodeSourcery




More information about the Gdb mailing list