Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: binutils@sourceware.org, gdb-patches@sourceware.org
Subject: Re: [RFC/RFA] dangling bfd pointer in archive cache...
Date: Thu, 04 Oct 2012 08:01:00 -0000	[thread overview]
Message-ID: <20121004080121.GF25219@bubble.grove.modra.org> (raw)
In-Reply-To: <20121003133019.GE3028@adacore.com>

On Wed, Oct 03, 2012 at 06:30:19AM -0700, Joel Brobecker wrote:
> Hello Alan,
> 
> Thanks for the review!
> 
> > On Tue, Oct 02, 2012 at 07:14:06AM -0700, Joel Brobecker wrote:
> > >         * opncls.c (bfd_close); Add call to _bfd_archive_close_and_cleanup.
> > 
> > No, we should already be calling _bfd_archive_close_and_cleanup via 
> 
> OK, but before I go ahead with your implementation, I wanted to
> make sure about something...
> 
> > > --- a/bfd/opncls.c
> > > +++ b/bfd/opncls.c
> > > @@ -719,6 +719,17 @@ bfd_close (bfd *abfd)
> > >    if (! BFD_SEND (abfd, _close_and_cleanup, (abfd)))
> > 
> > this call.  The problem is in coff-rs6000.c (and coff64-rs6000.c)
> > where the bfd_target vector just uses bfd_true for close_and_cleanup.
> 
> ... My reasoning is that this part of the job isn't target-specific.

but it may become target specific at some future date..

> It's entirely related to how the generic side of archives is handled,
> not to the target itself. To me, it needs to be called regardless
> of the actual target, and requiring that the target code set it up
> is a recipe for having some of them forgetting to do it (which is
> what actually happened here).

This is not the first time we've seen this sort of problem, due to
coff-rs6000.c filling in a bfd_target struct by hand.  I don't know
why it wasn't written to use one of the COFF_TARGET_VEC macros, or at
the very least, using all the BFD_JUMP_TABLE macros.

-- 
Alan Modra
Australia Development Lab, IBM


  reply	other threads:[~2012-10-04  8:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 14:14 Joel Brobecker
2012-10-03  5:29 ` Alan Modra
2012-10-03 13:30   ` Joel Brobecker
2012-10-04  8:01     ` Alan Modra [this message]
2012-10-15 18:01   ` Joel Brobecker
2012-10-16  1:48     ` Alan Modra
2012-10-16 22:58       ` Joel Brobecker

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=20121004080121.GF25219@bubble.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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