From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16360 invoked by alias); 17 Jan 2002 01:23:53 -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 16320 invoked from network); 17 Jan 2002 01:23:52 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 17 Jan 2002 01:23:52 -0000 Received: from localhost.cygnus.com (cse.sfbay.redhat.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id RAA15765; Wed, 16 Jan 2002 17:23:51 -0800 (PST) Received: (from ezannoni@localhost) by localhost.cygnus.com (8.11.2/8.11.2) id g0H0abn02115; Wed, 16 Jan 2002 19:36:37 -0500 From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15430.7317.604827.777838@localhost.cygnus.com> Date: Wed, 16 Jan 2002 17:23:00 -0000 To: Doug Evans Cc: gdb@sources.redhat.com Subject: Re: max 64 sections?? In-Reply-To: <200201170053.QAA27077@casey.transmeta.com> References: <200201170053.QAA27077@casey.transmeta.com> X-Mailer: VM 7.00 under Emacs 20.7.1 X-SW-Source: 2002-01/txt/msg00179.txt.bz2 Doug Evans writes: > I'm seeing an error in gdb where a symbol is being added to the > symbol table with a bogus address. > > In debugging this, I found this in symfile.c:default_symfile_offsets > > objfile->num_sections = SECT_OFF_MAX; > objfile->section_offsets = (struct section_offsets *) > obstack_alloc (&objfile->psymbol_obstack, SIZEOF_SECTION_OFFSETS); > memset (objfile->section_offsets, 0, SIZEOF_SECTION_OFFSETS); > > The bogus address is coming from objfile->section_offsets->offsets[228]. > SECT_OFF_MAX is only 64. > > The elf file in question has _many_ sections. > > So what's up? Should objfile->section_offsets have been allocated > with slots for the same number of sections as in the objfile? > Doug, Yes, you are not hallucinating. This is a long standing problem. Feel free to enter a bug report in the gnat database. Elena > Or is this line in elfread.c:elf_symtab_read wrong? > > offset = ANOFFSET (objfile->section_offsets, sym->section->index); > > Here's where the bogus address gets computed, later in elf_symtab_read: > > /* Relocate all non-absolute symbols by the section offset. */ > if (sym->section != &bfd_abs_section) > { > symaddr += offset; > } > > Or have I overlooked something?