From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23772 invoked by alias); 30 Jul 2004 00:31:41 -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 23738 invoked from network); 30 Jul 2004 00:31:40 -0000 Received: from unknown (HELO iris1.csv.ica.uni-stuttgart.de) (129.69.118.2) by sourceware.org with SMTP; 30 Jul 2004 00:31:40 -0000 Received: from rembrandt.csv.ica.uni-stuttgart.de ([129.69.118.42] ident=mail) by iris1.csv.ica.uni-stuttgart.de with esmtp id 1BqLJC-0000FK-00; Fri, 30 Jul 2004 02:31:38 +0200 Received: from ica2_ts by rembrandt.csv.ica.uni-stuttgart.de with local (Exim 3.35 #1 (Debian)) id 1BqLJC-00058Y-00; Fri, 30 Jul 2004 02:31:38 +0200 Date: Fri, 30 Jul 2004 00:31:00 -0000 To: Mark Kettenis Cc: brobecker@gnat.com, binutils@sources.redhat.com, gdb-patches@sources.redhat.com Subject: Re: [RFA] MIPS_TEXT symbols should be associated to .text section? Message-ID: <20040730003138.GU965@rembrandt.csv.ica.uni-stuttgart.de> References: <20040721204604.GN1278@gnat.com> <20040729220156.GK1167@gnat.com> <20040729221904.GT965@rembrandt.csv.ica.uni-stuttgart.de> <200407292314.i6TNEqwV024526@elgar.kettenis.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200407292314.i6TNEqwV024526@elgar.kettenis.dyndns.org> User-Agent: Mutt/1.5.6i From: Thiemo Seufer X-SW-Source: 2004-07/txt/msg00482.txt.bz2 Mark Kettenis wrote: > From: Thiemo Seufer > Date: Fri, 30 Jul 2004 00:19:04 +0200 > > Joel Brobecker wrote: > > Hello BFD maintainers, > > > > Ping? This patch is only 8 days old, and I wouldn't send a reminder > > just a week after sending it, but GDB is completely broken without > > this patch (ie "break main; run" doesn't work)... Would somebody mind > > having a look at it and tell me if it is good or not? > > Joel, I'm seeing similar problems on NetBSD/mips (NetBSD/pmax 1.6.2 to > be precise). AFAICS it will hit all elf{32-,32-n,64-}{big,little}mips targets (as opposed to *trad*mips), which are covered by SGI_COMPAT. > [snip] > > > > #if 0 /* for SGI_COMPAT */ > > > case SHN_MIPS_TEXT: > > > asym->section = mips_elf_text_section_ptr; > > The last three lines in this patch suggest AFAICS to use > mips_elf_text_section_ptr instead of bfd_get_section_by_name, > and to make the test conditional on SGI_COMPAT. The SHN_MIPS_DATA > below should probably get handled similiarily. > > Well, mips_elf_text_section_ptr doesn't really exist. Right, that appears to be some leftover of earlier code. Looks like elf_tdata()->elf_text_section replaced it. Joel, can you try the appended (untested) patch and tell me if it works for you? Thiemo 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 00:28:55 -0000 @@ -4192,15 +4192,31 @@ _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 = elf_tdata (abfd)->elf_text_section; + + 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 = elf_tdata (abfd)->elf_data_section; + + BFD_ASSERT (SGI_COMPAT (abfd)); + if (section != NULL) + asym->section = section; + } break; -#endif } }