From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25407 invoked by alias); 2 Apr 2003 17:28:28 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 25390 invoked from network); 2 Apr 2003 17:28:27 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 2 Apr 2003 17:28:27 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 190m2H-0008PV-00; Wed, 02 Apr 2003 11:28:29 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 190m2D-0008VW-00; Wed, 02 Apr 2003 12:28:25 -0500 Date: Wed, 02 Apr 2003 17:28:00 -0000 From: Daniel Jacobowitz To: gdb@sources.redhat.com, binutils@sources.redhat.com, nickc@redhat.com Subject: Re: gdb.mi/mi-cli.exp failures Message-ID: <20030402172825.GA32596@nevyn.them.org> Mail-Followup-To: gdb@sources.redhat.com, binutils@sources.redhat.com, nickc@redhat.com References: <3E88A369.6090403@redhat.com> <3E88AE3F.4030005@redhat.com> <3E89AB79.1060700@redhat.com> <3E89C7DB.3080906@redhat.com> <20030401182249.GB24160@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i X-SW-Source: 2003-04/txt/msg00029.txt.bz2 On Wed, Apr 02, 2003 at 09:21:13AM -0800, Ian Lance Taylor wrote: > Nick Clifton writes: > > > > It's doing this: > > > sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr"); > > > which doesn't make much sense to me; there's _already_ a section named > > > .stabstr in the executable, why not use that one? > > > > Hmm, agreed - this probably ought to be a call to > > bfd_get_section_by_name(). And if that fails then the code should try > > to find the output bfd and create the section there. (Either that or > > else return a failure result. Can you have a .stabs section without a > > .stabsstr section ?) > > I created a .stabstr section in the input file because I needed to > have a section in an input file which the linker script could put into > the output file correctly. This is not the only place where this > trick is used. > > Using an existing .stabstr section would have to be handled carefully. > The code would have to extract the information, and arrange to replace > it in the output file. This might not be too hard. > > Creating the .stabstr section in the output BFD doesn't work, because > it won't let the linker script function properly. Well, do you have another suggestion for how to approach this? We're not actually linking; but I need to get the symbols from the input file into a symbol table with forged offsets in order to apply relocations against them. > > > Can I not rely on section_count remaining stable for an input BFD? > > > > I think that you ought to be able to rely on this. > > Well, I'm afraid that you will have to deal with a number of other > cases if you want to avoid adding sections to input files. Take a > look at elf_link_create_dynamic_sections(). In any case I can remove the assumption; it's not hard. I assume that if I save pointers to the sections present before calling elf_link_add_object_symbols, that they'll still be valid when it returns? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer