From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14819 invoked by alias); 30 Jul 2004 23:03:13 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 14793 invoked from network); 30 Jul 2004 23:03:10 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (142.179.108.108) by sourceware.org with SMTP; 30 Jul 2004 23:03:10 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 1FAB747D91; Fri, 30 Jul 2004 16:03:10 -0700 (PDT) Date: Fri, 30 Jul 2004 23:03:00 -0000 From: Joel Brobecker To: Thiemo Seufer Cc: Mark Kettenis , binutils@sources.redhat.com, gdb-patches@sources.redhat.com Subject: Re: [RFA] MIPS_TEXT symbols should be associated to .text section? Message-ID: <20040730230309.GX1167@gnat.com> References: <20040721204604.GN1278@gnat.com> <20040729220156.GK1167@gnat.com> <20040729221904.GT965@rembrandt.csv.ica.uni-stuttgart.de> <200407292314.i6TNEqwV024526@elgar.kettenis.dyndns.org> <20040730003138.GU965@rembrandt.csv.ica.uni-stuttgart.de> <20040730180800.GQ1167@gnat.com> <20040730185728.GB965@rembrandt.csv.ica.uni-stuttgart.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040730185728.GB965@rembrandt.csv.ica.uni-stuttgart.de> User-Agent: Mutt/1.4i X-SW-Source: 2004-07/txt/msg00528.txt.bz2 Thiemo, > I prefer the first. Please test this patch. I successfully tested this patch using the following testsuites: - binutils - libiberty - gas - ld without any regression. I also verified that the problem fixes the GDB problem on IRIX, and ran the gdb-testsuite with success as well. I think we can commit this patch :-). I have write privs, if this can save you a couple minutes. > Index: bfd/elfxx-mips.c > =================================================================== > RCS file: /cvs/src/src/bfd/elfxx-mips.c,v > retrieving revision 1.106 > diff -u -p -r1.106 elfxx-mips.c > --- bfd/elfxx-mips.c 1 Jul 2004 14:53:40 -0000 1.106 > +++ bfd/elfxx-mips.c 30 Jul 2004 18:53:18 -0000 > @@ -4192,15 +4192,37 @@ _bfd_mips_elf_symbol_processing (bfd *ab > asym->section = bfd_und_section_ptr; > break; > > -#if 0 /* for SGI_COMPAT */ > case SHN_MIPS_TEXT: > - asym->section = mips_elf_text_section_ptr; > + { > + asection *section = bfd_get_section_by_name (abfd, ".text"); > + > + BFD_ASSERT (SGI_COMPAT (abfd)); > + if (section != NULL) > + { > + asym->section = section; > + /* MIPS_TEXT is a bit special, the address is not an offset > + to the base of the .text section. So substract the section > + base address to make it an offset. */ > + asym->value -= section->vma; > + } > + } > break; > > case SHN_MIPS_DATA: > - asym->section = mips_elf_data_section_ptr; > + { > + asection *section = bfd_get_section_by_name (abfd, ".data"); > + > + BFD_ASSERT (SGI_COMPAT (abfd)); > + if (section != NULL) > + { > + asym->section = section; > + /* MIPS_DATA is a bit special, the address is not an offset > + to the base of the .data section. So substract the section > + base address to make it an offset. */ > + asym->value -= section->vma; > + } > + } > break; > -#endif > } > } > Thanks, -- Joel