From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13095 invoked by alias); 15 May 2008 17:37:04 -0000 Received: (qmail 13076 invoked by uid 22791); 15 May 2008 17:37:01 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.29.150) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 15 May 2008 17:36:37 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.8/8.13.8) with ESMTP id m4FHaXxD145454 for ; Thu, 15 May 2008 17:36:33 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m4FHaXSU3960964 for ; Thu, 15 May 2008 19:36:33 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m4FHaXYa007942 for ; Thu, 15 May 2008 19:36:33 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id m4FHaXs3007939; Thu, 15 May 2008 19:36:33 +0200 Message-Id: <200805151736.m4FHaXs3007939@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 15 May 2008 19:36:33 +0200 Subject: Re: [rfc] Fix problem with (maybe) non-relocated .opd section on powerpc64-linux To: drow@false.org (Daniel Jacobowitz) Date: Thu, 15 May 2008 18:56:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <20080515165859.GA6488@caradoc.them.org> from "Daniel Jacobowitz" at May 15, 2008 12:58:59 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2008-05/txt/msg00473.txt.bz2 Daniel Jacobowitz wrote: > This makes the assumption that all .opd entries are always relocated > by the same offset the section itself was relocated. */ > > Do Linux kernel modules have an opd section? I'd recommend the > routine the dwarf reader uses to apply relocations except it would be > very inefficient unless we cached the result. Kernel modules generally have an opd section; as in other object files, these will carry a R_PPC64_ADDR64 relocation pointing to .text + some offset. (In shared libraries we see a R_PPC_RELATIVE instead.) That means my heuristics will probably go wrong when applied to an object file (or kernel module). When would that actually happen? Should we be using the ppc-linux-tdep.c gdbarch for that? I guess we could cache the result of symfile_relocate_debug_section on the .opd section for the objfile. One minor issue would be that this function currently refuses to operate on non-SEC_DEBUGGING sections -- is there a reason for that? As I understand symfile_relocate_debug_section, this would still *not* take the load address of a shared library into account, so that part would still need to be applied manually, right? > > > We went round the choice of where to read memory from several times on > > > the previous patch, but I don't know the details. > > > > OK, thanks. > > It looks like the main issue was making sure we did read from the > target if the target_ops provided said to; the exception being the use > of tmp_bfd_target in solib-svr4.c.I don't see a problem with your > change other than the offset assumption I mentioned above. Thanks! Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com