Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* max 64 sections??
@ 2002-01-16 16:54 Doug Evans
  2002-01-16 17:23 ` Elena Zannoni
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Evans @ 2002-01-16 16:54 UTC (permalink / raw)
  To: gdb

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?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-01-17  1:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-16 16:54 max 64 sections?? Doug Evans
2002-01-16 17:23 ` Elena Zannoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox