Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Jim Blandy <jimb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: PATCH: read stabs from files with no .data section
Date: Tue, 09 Sep 2003 18:22:00 -0000	[thread overview]
Message-ID: <3F5E1A4C.9080300@redhat.com> (raw)
In-Reply-To: <vt2r82pvosh.fsf@zenia.home>

> Andrew Cagney <ac131313@redhat.com> writes:
> 
> 
>> > +   /* If the objfile has no .data section, try using the .bss section.  */
>> > +   data_sect_index = objfile->sect_index_data;
>> > +   if (data_sect_index == -1)
>> > +     data_sect_index = SECT_OFF_BSS (objfile);
>> > +   gdb_assert (data_sect_index != -1);
>> > +
> 
>> 
>> So what happens if there is no .data and no .bss?
> 
> 
> We lose.  Maybe this should fall through the .rodata, and then .text
> section offsets, but I think it's still papering over the real
> problem, which I don't know how to solve.
> 
> I think the correct behavior is to use the offset of the section
> containing the variable.  Many of the old references to
> 
>   ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile))
> 
> that this patch changes were wrong, for this reason.
> 
> But to do the right thing, we'd need to look up the section by the
> variable's unrelocated address, as with find_pc_section.  This would
> be needed for every top-level variable, static and global, in the
> speed-critical partial symtab construction pass.  I'm not sure that
> kind of overhead would be welcome.

Ah.  Suggest adding a fixme describing this real problem to the code, 
and filing a bug report.

enjoy,
Andrew



  reply	other threads:[~2003-09-09 18:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-08 19:28 Jim Blandy
2003-09-09  3:30 ` Andrew Cagney
2003-09-09 17:47   ` Jim Blandy
2003-09-09 18:22     ` Andrew Cagney [this message]
2003-09-09 20:03       ` Jim Blandy

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=3F5E1A4C.9080300@redhat.com \
    --to=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@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