From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13212 invoked by alias); 30 Jul 2004 00:17:20 -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 13174 invoked from network); 30 Jul 2004 00:17:18 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (142.179.108.108) by sourceware.org with SMTP; 30 Jul 2004 00:17:18 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id BA13547D91; Thu, 29 Jul 2004 17:17:17 -0700 (PDT) Date: Fri, 30 Jul 2004 00:17:00 -0000 From: Joel Brobecker To: Thiemo Seufer Cc: binutils@sources.redhat.com, gdb-patches@sources.redhat.com Subject: Re: [RFA] MIPS_TEXT symbols should be associated to .text section? Message-ID: <20040730001717.GM1167@gnat.com> References: <20040721204604.GN1278@gnat.com> <20040729220156.GK1167@gnat.com> <20040729221904.GT965@rembrandt.csv.ica.uni-stuttgart.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040729221904.GT965@rembrandt.csv.ica.uni-stuttgart.de> User-Agent: Mutt/1.4i X-SW-Source: 2004-07/txt/msg00480.txt.bz2 Thiemo, Thanks for the prompt reply. And thanks also to Mark for the feedback. This is very helpful. > > > + case SHN_MIPS_TEXT: > > > + { > > > + asection *section = bfd_get_section_by_name (abfd, ".text"); > > > + 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; > > > + } > > > + > > > #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, I think the commented out code is out of date, mips_elf_text_section_ptr doesn't exist (anymore?). That's why I had to find it by name. I should really delete this code, I will include that in my next patch. > and to make the test conditional on SGI_COMPAT. I would have agreed to this, but Mark reported that he has the same problem on NetBSD/mips, so I guess the SGI_COMPAT is too narrow. What I can do is conditionalize this code on SHN_MIPS_TEXT itself? Would that make sense? (the thing is: we already SHN_MIPS_COMMON, SHN_MIPS_ACOMMON, etc, so do we really need to put any conditionalization?) > The SHN_MIPS_DATA > below should probably get handled similiarily. I agree. The reason why I didn't include MIPS_DATA to the patch is that I didn't find any example where I saw an object being in that special section. So I didn't want to change anything in case it would make it worse. If you think it should be included, I'll gladly do so (and contact Dave Anderson of SGI to confirm the meaning of this special st_shndx). Let me know. -- Joel