public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: gdb@sources.redhat.com, binutils@sources.redhat.com, nickc@redhat.com
Subject: Re: gdb.mi/mi-cli.exp failures
Date: Wed, 02 Apr 2003 17:28:00 -0000	[thread overview]
Message-ID: <20030402172825.GA32596@nevyn.them.org> (raw)
In-Reply-To: <m3n0j895o6.fsf@gossamer.airs.com>

On Wed, Apr 02, 2003 at 09:21:13AM -0800, Ian Lance Taylor wrote:
> Nick Clifton <nickc@redhat.com> writes:
> 
> > > It's doing this:
> > > 	sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr");
> > > which doesn't make much sense to me; there's _already_ a section named
> > > .stabstr in the executable, why not use that one?
> > 
> > Hmm, agreed - this probably ought to be a call to
> > bfd_get_section_by_name().  And if that fails then the code should try
> > to find the output bfd and create the section there.  (Either that or
> > else return a failure result.  Can you have a .stabs section without a
> > .stabsstr section ?)
> 
> I created a .stabstr section in the input file because I needed to
> have a section in an input file which the linker script could put into
> the output file correctly.  This is not the only place where this
> trick is used.
> 
> Using an existing .stabstr section would have to be handled carefully.
> The code would have to extract the information, and arrange to replace
> it in the output file.  This might not be too hard.
> 
> Creating the .stabstr section in the output BFD doesn't work, because
> it won't let the linker script function properly.

Well, do you have another suggestion for how to approach this?  We're
not actually linking; but I need to get the symbols from the input file
into a symbol table with forged offsets in order to apply relocations
against them.

> > > Can I not rely on section_count remaining stable for an input BFD?
> > 
> > I think that you ought to be able to rely on this.
> 
> Well, I'm afraid that you will have to deal with a number of other
> cases if you want to avoid adding sections to input files.  Take a
> look at elf_link_create_dynamic_sections().

In any case I can remove the assumption; it's not hard.  I assume that
if I save pointers to the sections present before calling
elf_link_add_object_symbols, that they'll still be valid when it
returns?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

  reply	other threads:[~2003-04-02 17:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-31 19:35 David Carlton
2003-03-31 20:22 ` Andrew Cagney
2003-03-31 21:08   ` Andrew Cagney
2003-03-31 21:20     ` Andrew Cagney
2003-04-01  1:09       ` Hans-Peter Nilsson
2003-04-01  1:38         ` Ian Lance Taylor
2003-04-01 10:18     ` Nick Clifton
2003-04-01 15:08       ` Andrew Cagney
2003-04-01 15:18         ` Daniel Jacobowitz
2003-04-01 16:22           ` Andrew Cagney
2003-04-01 16:34             ` Daniel Jacobowitz
2003-04-01 17:01               ` Andrew Cagney
2003-04-01 18:03                 ` Daniel Jacobowitz
     [not found]         ` <m31y0mxk8i.fsf@workshop.nickc.cambridge.redhat.com>
2003-04-01 17:09           ` Andrew Cagney
2003-04-01 18:23             ` Daniel Jacobowitz
2003-04-02 17:06               ` Nick Clifton
2003-04-02 17:13                 ` Daniel Jacobowitz
2003-04-02 17:21                 ` Ian Lance Taylor
2003-04-02 17:28                   ` Daniel Jacobowitz [this message]
2003-04-02 17:44                     ` Ian Lance Taylor
2003-04-02 18:05                       ` Daniel Jacobowitz
2003-04-02 20:39                         ` Ian Lance Taylor
2003-04-02 20:38                           ` Daniel Jacobowitz
2003-04-02 20:53                             ` Ian Lance Taylor

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=20030402172825.GA32596@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=binutils@sources.redhat.com \
    --cc=gdb@sources.redhat.com \
    --cc=nickc@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).