From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1620 invoked by alias); 12 Apr 2013 21:01:09 -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 1610 invoked by uid 89); 12 Apr 2013 21:01:09 -0000 X-Spam-SWARE-Status: No, score=-7.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BJ autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 12 Apr 2013 21:01:08 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3CL15w8022830 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Apr 2013 17:01:05 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3CL13nu028747 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 12 Apr 2013 17:01:04 -0400 From: Tom Tromey To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: FYI/prototype: re-implement relocs on ppc-aix References: <20130321222151.GH5447@adacore.com> <87d2urw7x2.fsf@fleche.redhat.com> <20130325194808.GL5447@adacore.com> Date: Mon, 15 Apr 2013 12:50:00 -0000 In-Reply-To: <20130325194808.GL5447@adacore.com> (Joel Brobecker's message of "Mon, 25 Mar 2013 12:48:08 -0700") Message-ID: <871uaffoq8.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-04/txt/msg00407.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Tom> It seems to me that the "gold-plated" method would be to change the code Tom> everywhere not to assume a "file name", but instead make a new "solib Tom> name" object that has virtual methods for its operations, and let AIX Tom> supply a subclass of this. Joel> [...] Tom> This is a lot more typing, especially if you went the full route and Tom> pushed it into objfiles as well, but I think it would avoid many issues Tom> as well. Joel> I see the beauty of it, but at the same time, this is introducing Joel> a second level of indirection; is it going to make things better Joel> than extending the current target_so_ops by adding handling of Joel> member objects? To me, it seems a little overkill, but I do not Joel> mind going that direction. (separate patch, probably not before Joel> the fall, unfortunately). Yeah, I don't know which is better. On the one hand, mine may be overkill, but on the other it may be better if we need future tweaks here. Tom> I think you could refactor default_symfile_offsets so that it calls a Tom> helper function, also called by xcoff_symfile_offsets, and which doesn't Tom> do this setting. Joel> I think I have an idea of what you mean, but I don't think I quite Joel> see what you mean in practice... Not a big problem, and easy to fix Joel> later on. I just mean taking the current default_symfile_offsets and changing it to: ... default_symfile_offsets_base () { ... everything except setting the offsets to defaults } default_symfile_offsets () { default_symfile_offsets_base() ... set the offsets to the defaults } Then your code can call default_symfile_offsets_base. Joel> +static struct obj_section * Joel> +data_obj_section_from_objfile (struct objfile *objfile) Joel> +{ Joel> + struct obj_section *osect; Joel> + Joel> + ALL_OBJFILE_OSECTIONS (objfile, osect) Joel> + if (strcmp (bfd_section_name (objfile->obfd, Joel> osect->the_bfd_section), Joel> + ".data") == 0) Joel> + return osect; Tom> Can this not look at objfile->data_sect_index? Joel> Not if I am understanding it right. objfile->sect_index_data is Joel> an index in the objfile->section_offsets array. I couldn't convince Joel> myself from the current documentation that those indices applied Joel> to both objfile->section_offsets and objfile->sections. It would be Joel> ideal if I could! After the obj_section merge, they are the same. Tom