From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2678 invoked by alias); 28 Oct 2013 11:39:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 2669 invoked by uid 89); 28 Oct 2013 11:39:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 28 Oct 2013 11:39:44 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 2606C116290; Mon, 28 Oct 2013 07:40:09 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ktwcb6c-M82b; Mon, 28 Oct 2013 07:40:09 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id BD91A116243; Mon, 28 Oct 2013 07:40:08 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 34DFDE069D; Mon, 28 Oct 2013 15:39:39 +0400 (RET) Date: Mon, 28 Oct 2013 11:39:00 -0000 From: Joel Brobecker To: Luis Machado Cc: "'gdb-patches@sourceware.org'" Subject: Re: checked in: Re: RFC: solib.c:solib_map_sections so->so_name clobbering Message-ID: <20131028113939.GC3066@adacore.com> References: <526B2936.3080208@codesourcery.com> <526B2A53.7080905@codesourcery.com> <20131026042902.GE4769@adacore.com> <526C7E65.6050308@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <526C7E65.6050308@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-10/txt/msg00850.txt.bz2 > >My suspicion is that the bfd_open callback takes care of the path > >translation, so the backend was allowing itself to defer it. I am > >not sure how difficult it would be to move that part to each backend. > > > >Reverting the patch would be a real issue, because it would mean > >that any given solib backend cannot set the so_name, and commands > >such as "info shared" would print a bogus shared library name. > >Nevertheless, if we did revert it, I think we can work around > >the issue by using the same trick as the one we used for the 7.6 > >branch IIRC. > > I wouldn't say this is critical, just a slight change from an > undocumented direction we've been following. :-) I had the weekend to think about it some more. To me, the most important aspect is that the output in GDB/MI is now incorrect, not just confusing. So I think something should be done about it, and sooner rather than later. At the moment, the approach I dislike the least is to revert my patch, and let the couple of solib backends (darwin, AIX) fix up the BFD filename, the same way we did on the gdb-7.6 branch: http://www.sourceware.org/ml/gdb-patches/2013-03/msg01084.html This fixup is what we used to do in the past, except that we were leaking memory. It's possible to do the same without the memory leak, thanks to a suggestion from Tom. It sounds contradictory to be suggesting this, since I think this is clearly a step in the wrong direction (making the semantics of that field a little iffy, since time-sensitive), but seems like an acceptable compromise between amount of work vs severity of the problem. The alternative would be, I think, to make sure that the various solib backends set the so_name properly. I'm not sure whether that's actually possible. I would need to study the framework a little longer, but lack the time at the moment. Other thoughts/suggestions? Thanks, -- Joel