This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: max 64 sections??
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: Doug Evans <dje at transmeta dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 16 Jan 2002 19:36:37 -0500
- Subject: Re: max 64 sections??
- References: <200201170053.QAA27077@casey.transmeta.com>
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?