From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29432 invoked by alias); 11 Apr 2006 09:01:02 -0000 Received: (qmail 29420 invoked by uid 22791); 11 Apr 2006 09:01:01 -0000 X-Spam-Check-By: sourceware.org Received: from smtp7.wanadoo.fr (HELO smtp7.wanadoo.fr) (193.252.22.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 11 Apr 2006 09:00:59 +0000 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf0712.wanadoo.fr (SMTP Server) with ESMTP id 34BDA1C000B5 for ; Tue, 11 Apr 2006 11:00:57 +0200 (CEST) Received: from w98.wanadoo.fr (AMarseille-252-1-93-225.w86-202.abo.wanadoo.fr [86.202.148.225]) by mwinf0712.wanadoo.fr (SMTP Server) with ESMTP id 5BB211C000B9 for ; Tue, 11 Apr 2006 11:00:56 +0200 (CEST) X-ME-UUID: 20060411090056375.5BB211C000B9@mwinf0712.wanadoo.fr Message-Id: <6.1.0.6.0.20060411102654.00ad0710@pop.wanadoo.fr> X-Sender: jr.peulve@pop.wanadoo.fr Date: Tue, 11 Apr 2006 13:33:00 -0000 To: gdb@sources.redhat.com From: Jean-Rene Peulve Subject: Wrong address for static function in linux module Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00128.txt.bz2 Hi, I am debugging a linux module on a Coldfire and I encounter the following problem: -functions which have the static attribut are always relocated at offset 0 of the .text section with the break command when the display command at = the right address disassemble the right static function. -functions without the static attribut are relocated properly. I found out that the psymtab entry for a static function is relocated at = the right offset in the .text section when the symtab entry for the same func= tion is relocated at offset 0 of the .text section. To generate the target software, I use gcc 2.95.3 I was using gdb 5.2.1, then I fetch gdb-6.4.50.20060405 and get the same problem. Here are the details: The nm command gives: - 00000136 t horloge_read - 0000037a T HorlogeCheck I put a breakpoint at exit of the lookup_symbol to display the content of t= he struct symbol (here this is gdb-6.4.50.20060405): (top-gdb) b lookup_symbol During symbol reading, inner block (0x770-0x83d) not inside outer block=20 (0x80a309 c-0x80a31a4). During symbol reading, block at 0x776 out of order. Breakpoint 3 at 0x80a378d: file ../../gdb-6.4.50.20060405/gdb/symtab.c,=20 line 1028 =2E (top-gdb) c Continuing. Breakpoint 3, lookup_symbol (name=3D0x832d180 "HorlogeCheck", block=3D0x0, domain=3DVAR_DOMAIN, is_a_field_of_this=3D0x0, symtab=3D0x0) at ../../gdb-6.4.50.20060405/gdb/symtab.c:1028 1028 if (current_language->la_language =3D=3D language_cplus) (top-gdb) fin Run till exit from #0 lookup_symbol (name=3D0x832d180 "HorlogeCheck",=20 block=3D0x0, domain=3DVAR_DOMAIN, is_a_field_of_this=3D0x0, symtab=3D0x0) at ../../gdb-6.4.50.20060405/gdb/symtab.c:1028 c_lex () at c-exp.y:1740 1740 if (sym && SYMBOL_CLASS (sym) =3D=3D LOC_BLOCK) Value returned is $1 =3D (struct symbol *) 0x83f1ab0 (top-gdb) p *(struct symbol *) 0x83f1ab0 $2 =3D {ginfo =3D {name =3D 0x8381388 "HorlogeCheck", value =3D {ivalue =3D= 138353432, block =3D 0x83f1b18, bytes =3D 0x83f1b18 "=DA\003y", address =3D 138= 353432, chain =3D 0x83f1b18}, language_specific =3D {cplus_specific =3D { demangled_name =3D 0x0}}, language =3D language_c, section =3D 0, bfd_section =3D 0x837da44}, type =3D 0x83f1ad8, domain =3D VAR_DOMAIN, aclass =3D LOC_BLOCK, line =3D 627, ops =3D 0x0, aux_value =3D {basereg = =3D 0, ptr =3D 0x0}, hash_next =3D 0x0} (top-gdb) x/x ((struct symbol *) 0x83f1ab0)->ginfo.value.ivalue 0x83f1b18: 0x007903da <<<=3D=3D=3D offset 0x37a of .text OK (top-gdb) c Continuing. Breakpoint 3, lookup_symbol (name=3D0x832d180 "horloge_read", block=3D0x0, domain=3DVAR_DOMAIN, is_a_field_of_this=3D0x0, symtab=3D0x0) at ../../gdb-6.4.50.20060405/gdb/symtab.c:1028 1028 if (current_language->la_language =3D=3D language_cplus) (top-gdb) fin Run till exit from #0 lookup_symbol (name=3D0x832d180 "horloge_read",=20 block=3D0x0, domain=3DVAR_DOMAIN, is_a_field_of_this=3D0x0, symtab=3D0x0) at ../../gdb-6.4.50.20060405/gdb/symtab.c:1028 c_lex () at c-exp.y:1740 1740 if (sym && SYMBOL_CLASS (sym) =3D=3D LOC_BLOCK) Value returned is $3 =3D (struct symbol *) 0x83e6e3c (top-gdb) p *(struct symbol *) 0x83e6e3c $4 =3D {ginfo =3D {name =3D 0x8381284 "horloge_read", value =3D {ivalue =3D= 138309632, block =3D 0x83e7000, bytes =3D 0x83e7000 "`", address =3D 138309632, chain =3D 0x83e7000}, language_specific =3D {cplus_specific =3D { demangled_name =3D 0x0}}, language =3D language_c, section =3D 0, bfd_section =3D 0x837da44}, type =3D 0x83e6e64, domain =3D VAR_DOMAIN, aclass =3D LOC_BLOCK, line =3D 375, ops =3D 0x0, aux_value =3D {basereg = =3D 0, ptr =3D 0x0}, hash_next =3D 0x0} (top-gdb) x/x ((struct symbol *) 0x83e6e3c)->ginfo.value.ivalue 0x83e7000: 0x00790060 <<<=3D=3D=3D offset 0 of .text BAD BAD (top-gdb) I tried to go further to debug this problem but without succes so far. Any help would be appreciated. Jean-Rene Peulve