From: Doug Evans <dje@transmeta.com>
To: gdb@sources.redhat.com
Subject: max 64 sections??
Date: Wed, 16 Jan 2002 16:54:00 -0000 [thread overview]
Message-ID: <200201170053.QAA27077@casey.transmeta.com> (raw)
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?
next reply other threads:[~2002-01-17 0:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-16 16:54 Doug Evans [this message]
2002-01-16 17:23 ` Elena Zannoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200201170053.QAA27077@casey.transmeta.com \
--to=dje@transmeta.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox