From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22218 invoked by alias); 7 Apr 2003 11:54:31 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22210 invoked from network); 7 Apr 2003 11:54:29 -0000 Received: from unknown (HELO smtp016.mail.yahoo.com) (216.136.174.113) by sources.redhat.com with SMTP; 7 Apr 2003 11:54:29 -0000 Received: from adsl-solo-106-226.claranet.co.uk (HELO albert) (RaoulGough@217.158.106.226 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 7 Apr 2003 11:54:28 -0000 Message-ID: <002a01c2fcfc$7a0e4970$0201a8c0@albert> From: "Raoul Gough" To: Cc: "Elena Zannoni" References: <16012.44364.781796.157557@localhost.redhat.com> Subject: Re: RFC: coffread.c relocation fixes Date: Mon, 07 Apr 2003 11:54:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-SW-Source: 2003-04/txt/msg00110.txt.bz2 "Elena Zannoni" wrote in message news:16012.44364.781796.157557@localhost.redhat.com... > Raoul Gough writes: > > When a shared object can't be loaded at its preferred image base, it > > gets relocated. There's a convoluted switch statement in > > coff_symtab_read that handles relocation of the symbols, and I believe > > it handles a couple of cases incorrectly: > > > > o Static symbols (with c_sclass of C_STAT) never get relocated. I > > think this is wrong, probably an oversight where the C_STAT cases fall > > through to the C_EXT case and then don't get handled. > > > > o Absolute symbols (with c_secnum of N_ABS) *do* get relocated, so > > things like __minor_os_version__ get adjusted by the relocation > > offset. Curiously, there is a fixme comment in the code not to do > > this. > > > > The attached exmple shows the problem in action and the attached diffs > > fix both problems. Do these changes seem sensible to others? > > I am not a coff expert, but the change seems sensible. > See below for a typo. > Did you run the gdb testsuite with your patch and w/o? Any differences? > > elena I'm still not geared up to run the test suites (I guess I just need to install dejagnu). Will try to manage this by the end of the week, and report back... Will fix the typo as well - thanks! -- Raoul Gough see http://home.clara.net/raoulgough/ for my work availability