From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8157 invoked by alias); 17 Jan 2002 00:54:08 -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 8118 invoked from network); 17 Jan 2002 00:54:05 -0000 Received: from unknown (HELO neon-gw.transmeta.com) (63.209.4.196) by sources.redhat.com with SMTP; 17 Jan 2002 00:54:05 -0000 Received: (from root@localhost) by neon-gw.transmeta.com (8.9.3/8.9.3) id QAA08844 for ; Wed, 16 Jan 2002 16:54:00 -0800 Received: from mailhost.transmeta.com(10.1.1.15) by neon-gw.transmeta.com via smap (V2.1) id xma008816; Wed, 16 Jan 02 16:53:38 -0800 Received: from casey.transmeta.com (casey.transmeta.com [10.10.25.22]) by deepthought.transmeta.com (8.11.6/8.11.6) with ESMTP id g0H0rgS02886 for ; Wed, 16 Jan 2002 16:53:42 -0800 (PST) Received: (from dje@localhost) by casey.transmeta.com (8.9.3/8.7.3) id QAA27077; Wed, 16 Jan 2002 16:53:42 -0800 Date: Wed, 16 Jan 2002 16:54:00 -0000 Message-Id: <200201170053.QAA27077@casey.transmeta.com> X-Authentication-Warning: casey.transmeta.com: dje set sender to dje@casey.transmeta.com using -f From: Doug Evans To: gdb@sources.redhat.com Subject: max 64 sections?? X-SW-Source: 2002-01/txt/msg00178.txt.bz2 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? 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?