Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Giving canonical sections a name breaks GDB?
@ 2004-12-20 12:41 Mark Kettenis
  2004-12-20 22:35 ` Alan Modra
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Kettenis @ 2004-12-20 12:41 UTC (permalink / raw)
  To: amodra; +Cc: binutils, gdb

Hi Alan,

GDB is a wee bit broken on sparc-sun-solaris2.9, and it seems the
following patch is the culprit:

2004-12-11  Alan Modra  <amodra@bigpond.net.au>

        * elfcode.h (elf_slurp_symbol_table): Use bfd_elf_sym_name so that
        canonical sections syms have a name.

With this patch, I get the following output in GDB:

(gdb) disas main
Dump of assembler code for function main:
0x00012928 <main+0>:    save  %sp, -1272, %sp
0x0001292c <main+4>:    sethi  %hi(0x24400), %o0
..
0x0001351c <main+3060>: ld  [ %o0 ], %o1
0x00013520 <main+3064>: ld  [ %o1 ], %o0
0x00013524 <.SUNW_version+0>:   st  %o0, [ %fp + -952 ]
0x00013528 <.SUNW_version+4>:   ld  [ %o1 + 4 ], %o0
..
0x00013b60 <.SUNW_version+1596>:        ret 
0x00013b64 <.SUNW_version+1600>:        restore 
End of assembler dump.

(.SUNW_version is the name of one of the sections in the ELF file)

without the patch above, everything is fine.

Any idea what's wrong?

Mark


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Giving canonical sections a name breaks GDB?
  2004-12-20 12:41 Giving canonical sections a name breaks GDB? Mark Kettenis
@ 2004-12-20 22:35 ` Alan Modra
  2004-12-21 20:28   ` Mark Kettenis
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Modra @ 2004-12-20 22:35 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: binutils, gdb

On Mon, Dec 20, 2004 at 01:41:12PM +0100, Mark Kettenis wrote:
> Any idea what's wrong?

Try this

	* elfread.c (elf_symtab_read): Discard section syms.

Index: gdb/elfread.c
===================================================================
RCS file: /cvs/src/src/gdb/elfread.c,v
retrieving revision 1.47
diff -u -p -r1.47 elfread.c
--- gdb/elfread.c	23 Oct 2004 16:18:08 -0000	1.47
+++ gdb/elfread.c	20 Dec 2004 22:34:20 -0000
@@ -254,6 +254,8 @@ elf_symtab_read (struct objfile *objfile
 			      &objfile->objfile_obstack);
 #endif
 	    }
+	  else if (sym->flags & BSF_SECTION_SYM)
+	    continue;
 	  else if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK))
 	    {
 	      struct minimal_symbol *msym;

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Giving canonical sections a name breaks GDB?
  2004-12-20 22:35 ` Alan Modra
@ 2004-12-21 20:28   ` Mark Kettenis
  2005-01-16 19:44     ` [PING] " Mark Kettenis
  2005-02-21 20:09     ` Alan Modra
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Kettenis @ 2004-12-21 20:28 UTC (permalink / raw)
  To: amodra, ezannoni; +Cc: binutils, gdb

   Date: Tue, 21 Dec 2004 09:04:49 +1030
   From: Alan Modra <amodra@bigpond.net.au>

   On Mon, Dec 20, 2004 at 01:41:12PM +0100, Mark Kettenis wrote:
   > Any idea what's wrong?

   Try this

	   * elfread.c (elf_symtab_read): Discard section syms.

Thanks, yes, that solves the problem.  Elena, is this ok?  Perhaps it
needs a comment?

Mark


Index: gdb/elfread.c
===================================================================
RCS file: /cvs/src/src/gdb/elfread.c,v
retrieving revision 1.47
diff -u -p -r1.47 elfread.c
--- gdb/elfread.c	23 Oct 2004 16:18:08 -0000	1.47
+++ gdb/elfread.c	20 Dec 2004 22:34:20 -0000
@@ -254,6 +254,8 @@ elf_symtab_read (struct objfile *objfile
 			      &objfile->objfile_obstack);
 #endif
 	    }
+	  else if (sym->flags & BSF_SECTION_SYM)
+	    continue;
 	  else if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK))
 	    {
 	      struct minimal_symbol *msym;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PING] Re: Giving canonical sections a name breaks GDB?
  2004-12-21 20:28   ` Mark Kettenis
@ 2005-01-16 19:44     ` Mark Kettenis
  2005-01-25 21:09       ` Mark Kettenis
  2005-02-21 20:09     ` Alan Modra
  1 sibling, 1 reply; 6+ messages in thread
From: Mark Kettenis @ 2005-01-16 19:44 UTC (permalink / raw)
  To: ezannoni, gdb

Elena, is this patch ok?

   Date: Tue, 21 Dec 2004 21:27:40 +0100 (CET)
   From: Mark Kettenis <kettenis@gnu.org>

      Date: Tue, 21 Dec 2004 09:04:49 +1030
      From: Alan Modra <amodra@bigpond.net.au>

      On Mon, Dec 20, 2004 at 01:41:12PM +0100, Mark Kettenis wrote:
      > Any idea what's wrong?

      Try this

	      * elfread.c (elf_symtab_read): Discard section syms.

   Thanks, yes, that solves the problem.  Elena, is this ok?  Perhaps it
   needs a comment?

   Mark


   Index: gdb/elfread.c
   ===================================================================
   RCS file: /cvs/src/src/gdb/elfread.c,v
   retrieving revision 1.47
   diff -u -p -r1.47 elfread.c
   --- gdb/elfread.c	23 Oct 2004 16:18:08 -0000	1.47
   +++ gdb/elfread.c	20 Dec 2004 22:34:20 -0000
   @@ -254,6 +254,8 @@ elf_symtab_read (struct objfile *objfile
				 &objfile->objfile_obstack);
    #endif
	       }
   +	  else if (sym->flags & BSF_SECTION_SYM)
   +	    continue;
	     else if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK))
	       {
		 struct minimal_symbol *msym;


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PING] Re: Giving canonical sections a name breaks GDB?
  2005-01-16 19:44     ` [PING] " Mark Kettenis
@ 2005-01-25 21:09       ` Mark Kettenis
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Kettenis @ 2005-01-25 21:09 UTC (permalink / raw)
  To: ezannoni, gdb

[ Ping ]

Elena, is this patch ok?

   Date: Tue, 21 Dec 2004 21:27:40 +0100 (CET)
   From: Mark Kettenis <kettenis@gnu.org>

      Date: Tue, 21 Dec 2004 09:04:49 +1030
      From: Alan Modra <amodra@bigpond.net.au>

      On Mon, Dec 20, 2004 at 01:41:12PM +0100, Mark Kettenis wrote:
      > Any idea what's wrong?

      Try this

	      * elfread.c (elf_symtab_read): Discard section syms.

   Thanks, yes, that solves the problem.  Elena, is this ok?  Perhaps it
   needs a comment?

   Mark


   Index: gdb/elfread.c
   ===================================================================
   RCS file: /cvs/src/src/gdb/elfread.c,v
   retrieving revision 1.47
   diff -u -p -r1.47 elfread.c
   --- gdb/elfread.c	23 Oct 2004 16:18:08 -0000	1.47
   +++ gdb/elfread.c	20 Dec 2004 22:34:20 -0000
   @@ -254,6 +254,8 @@ elf_symtab_read (struct objfile *objfile
				 &objfile->objfile_obstack);
    #endif
	       }
   +	  else if (sym->flags & BSF_SECTION_SYM)
   +	    continue;
	     else if (sym->flags & (BSF_GLOBAL | BSF_LOCAL | BSF_WEAK))
	       {
		 struct minimal_symbol *msym;



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Giving canonical sections a name breaks GDB?
  2004-12-21 20:28   ` Mark Kettenis
  2005-01-16 19:44     ` [PING] " Mark Kettenis
@ 2005-02-21 20:09     ` Alan Modra
  1 sibling, 0 replies; 6+ messages in thread
From: Alan Modra @ 2005-02-21 20:09 UTC (permalink / raw)
  To: ezannoni, gdb

On Tue, Dec 21, 2004 at 09:27:40PM +0100, Mark Kettenis wrote:
>    Date: Tue, 21 Dec 2004 09:04:49 +1030
>    From: Alan Modra <amodra@bigpond.net.au>
> 
> 	   * elfread.c (elf_symtab_read): Discard section syms.
> 
> Thanks, yes, that solves the problem.  Elena, is this ok?  Perhaps it
> needs a comment?

Since no one wants to give explicit approval, I'm committing it as
obvious, which I should have done in the first place.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-02-21 11:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-20 12:41 Giving canonical sections a name breaks GDB? Mark Kettenis
2004-12-20 22:35 ` Alan Modra
2004-12-21 20:28   ` Mark Kettenis
2005-01-16 19:44     ` [PING] " Mark Kettenis
2005-01-25 21:09       ` Mark Kettenis
2005-02-21 20:09     ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox