From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2746 invoked by alias); 13 Jun 2007 02:21:52 -0000 Received: (qmail 2738 invoked by uid 22791); 13 Jun 2007 02:21:51 -0000 X-Spam-Check-By: sourceware.org Received: from pool-71-248-179-245.bstnma.fios.verizon.net (HELO cgf.cx) (71.248.179.245) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 13 Jun 2007 02:21:49 +0000 Received: by cgf.cx (Postfix, from userid 201) id BCCF32B352; Tue, 12 Jun 2007 22:21:50 -0400 (EDT) Date: Wed, 13 Jun 2007 02:21:00 -0000 From: Christopher Faylor To: Pedro Alves , gdb-patches@sourceware.org, Joel Brobecker Subject: Re: [win32] wrong solib from/to addresses Message-ID: <20070613022150.GA12337@ednor.casa1.cgf.cx> Mail-Followup-To: Pedro Alves , gdb-patches@sourceware.org, Joel Brobecker References: <20070612204900.GA4435@adacore.com> <466F2D27.9000107@portugalmail.pt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <466F2D27.9000107@portugalmail.pt> User-Agent: Mutt/1.5.15 (2007-04-06) 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: 2007-06/txt/msg00213.txt.bz2 On Wed, Jun 13, 2007 at 12:32:55AM +0100, Pedro Alves wrote: > Hi Joel, > > Joel Brobecker wrote: >> We are working on porting our product to Vista, and we have noticed >> an issue that this version of the MS OS makes more apparent: The from/to >> addresses printed in the "info shared" listing are correct only when >> the DLL was loaded at the prefered load address (which is in the >> ImageBase field of the COFF/PE header). >> I collegue of mine told me that, for security reasons, system DLLs >> on Vista are now always rebased, and thus, the information printed >> by info based is off by a certain offset. >> The core of the attached patch is to implement the target_so_ops >> method relocate_section_addresses. For that, I needed to compute >> the offset between the load address and the image_base, and store >> it for later use (during the call of our routine above). There >> were two challenges: >> 1. Compute this image base. Rather than dig into the COFF/PE >> data, I took a simpler route that I think has already been >> taken: Use the start address of the .text section. I think >> this is already used to do the symbol relocation. >> 2. Make that information available: I found that the lm_info >> field was not allocated, so I had to add its initialization. >> With all these changes, the address are correct again. > > > I had a similar patch here, that I dumped in favor of a rewrite > of win32 solibs on top of Daniel's pending solib-target.c. That sounds like the right way to go to me. Can we hold of on this until Daniel's changes are in? cgf