From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29600 invoked by alias); 23 May 2003 16:19:38 -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 29593 invoked from network); 23 May 2003 16:19:37 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 23 May 2003 16:19:37 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h4NGJbH01102 for ; Fri, 23 May 2003 12:19:37 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h4NGJbI07563 for ; Fri, 23 May 2003 12:19:37 -0400 Received: from localhost.redhat.com (IDENT:YDpIp5gZHvqIbNkfHARBGXifdOWnDNqs@tooth.toronto.redhat.com [172.16.14.29]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h4NGJZo05685; Fri, 23 May 2003 12:19:35 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id 8C1922C43D; Fri, 23 May 2003 12:25:04 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16078.19295.731449.579816@localhost.redhat.com> Date: Fri, 23 May 2003 16:19:00 -0000 To: "Raoul Gough" Cc: , "Elena Zannoni" , mec@shout.net Subject: Re: RFC: coffread.c relocation fixes In-Reply-To: <018401c318a5$099c3b10$0200a8c0@albert> References: <16012.44364.781796.157557@localhost.redhat.com> <018401c318a5$099c3b10$0200a8c0@albert> X-SW-Source: 2003-05/txt/msg00457.txt.bz2 Raoul Gough writes: > "Elena Zannoni" wrote in message > news:16012.44364.781796.157557@localhost.redhat.com... > > Raoul Gough writes: > [snip] > > > 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? > > I've checked my coffread.c patches against the testsuite, without > finding any regressions under Cygwin or Linux (not COFF based, so > there wouldn't be any changes expected, of course). I've also written > a new testsuite script that demonstrates the problem and tests the > fix. I've added the script as a note to PR 1132 in GNATS (see > http://sources.redhat.com/ml/gdb-prs/2003-q2/msg00129.html). > I don't have much comments on the test (except that the convention is to use '-' instead of '_' in file names, and that you need to update the gdb/config/djgpp/fnchange.lst file). I wonder if instead of 'while 1' you could use exp_continue. MichaelC? > I've attached an updated diff to this posting with a fix for the typo > that Elena identified. Any advice on getting these patches checked in > and the PR closed? I can't do it myself, since I don't have any write > access. > I can commit it for you. elena > Regards, > Raoul Gough > Index: coffread.c > =================================================================== > RCS file: /cvs/src/src/gdb/coffread.c,v > retrieving revision 1.37 > diff -c -p -r1.37 coffread.c > *** coffread.c 25 Feb 2003 21:36:17 -0000 1.37 > --- coffread.c 12 May 2003 16:29:47 -0000 > *************** coff_symtab_read (long symtab_offset, un > *** 869,875 **** > print_address_symbolic work right without the (now > gone) "set fast-symbolic-addr off" kludge. */ > > - /* FIXME: should use mst_abs, and not relocate, if absolute. */ > enum minimal_symbol_type ms_type; > int sec; > > --- 869,874 ---- > *************** coff_symtab_read (long symtab_offset, un > *** 891,902 **** > || cs->c_sclass == C_THUMBEXT ? > mst_bss : mst_file_bss; > } > else > { > sec = cs_to_section (cs, objfile); > tmpaddr = cs->c_value; > ! if (cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXTFUNC > ! || cs->c_sclass == C_THUMBEXT) > tmpaddr += ANOFFSET (objfile->section_offsets, sec); > > if (sec == SECT_OFF_TEXT (objfile)) > --- 890,913 ---- > || cs->c_sclass == C_THUMBEXT ? > mst_bss : mst_file_bss; > } > + else if (cs->c_secnum == N_ABS) > + { > + /* Use the correct minimal symbol type (and don't > + relocate) for absolute values. */ > + ms_type = mst_abs; > + sec = cs_to_section (cs, objfile); > + tmpaddr = cs->c_value; > + } > else > { > sec = cs_to_section (cs, objfile); > tmpaddr = cs->c_value; > ! > ! /* Statics in a PE file also get relocated */ > ! if (cs->c_sclass == C_EXT > ! || cs->c_sclass == C_THUMBEXTFUNC > ! || cs->c_sclass == C_THUMBEXT > ! || (pe_file && (cs->c_sclass == C_STAT))) > tmpaddr += ANOFFSET (objfile->section_offsets, sec); > > if (sec == SECT_OFF_TEXT (objfile)) > 2003-02-26 Raoul Gough > > * coffread.c(coff_symtab_read): DO relocate static symbols from PE > files, DON'T relocate absolute symbols (and DO use mst_abs).