From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9704 invoked by alias); 12 May 2003 16:38:45 -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 9484 invoked from network); 12 May 2003 16:38:42 -0000 Received: from unknown (HELO smtp011.mail.yahoo.com) (216.136.173.31) by sources.redhat.com with SMTP; 12 May 2003 16:38:42 -0000 Received: from adsl-solo-210-205.claranet.co.uk (HELO albert) (RaoulGough@217.158.210.205 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 12 May 2003 16:38:39 -0000 Message-ID: <018401c318a5$099c3b10$0200a8c0@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, 12 May 2003 16:38:00 -0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0181_01C318AD.62D91AB0" X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-SW-Source: 2003-05/txt/msg00183.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_0181_01C318AD.62D91AB0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-length: 1072 "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'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. Regards, Raoul Gough ------=_NextPart_000_0181_01C318AD.62D91AB0 Content-Type: text/plain; name="coffread.c.diff.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="coffread.c.diff.txt" Content-length: 2027 Index: coffread.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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. */ =20=20 - /* FIXME: should use mst_abs, and not relocate, if absolute. */ enum minimal_symbol_type ms_type; int sec; =20=20 --- 869,874 ---- *************** coff_symtab_read (long symtab_offset, un *** 891,902 **** || cs->c_sclass =3D=3D C_THUMBEXT ? mst_bss : mst_file_bss; } else { sec =3D cs_to_section (cs, objfile); tmpaddr =3D cs->c_value; ! if (cs->c_sclass =3D=3D C_EXT || cs->c_sclass =3D=3D C_THUMBEXTFUNC ! || cs->c_sclass =3D=3D C_THUMBEXT) tmpaddr +=3D ANOFFSET (objfile->section_offsets, sec); =20=20 if (sec =3D=3D SECT_OFF_TEXT (objfile)) --- 890,913 ---- || cs->c_sclass =3D=3D C_THUMBEXT ? mst_bss : mst_file_bss; } + else if (cs->c_secnum =3D=3D N_ABS) + { + /* Use the correct minimal symbol type (and don't + relocate) for absolute values. */ + ms_type =3D mst_abs; + sec =3D cs_to_section (cs, objfile); + tmpaddr =3D cs->c_value; + } else { sec =3D cs_to_section (cs, objfile); tmpaddr =3D cs->c_value; !=20 ! /* Statics in a PE file also get relocated */ ! if (cs->c_sclass =3D=3D C_EXT ! || cs->c_sclass =3D=3D C_THUMBEXTFUNC ! || cs->c_sclass =3D=3D C_THUMBEXT ! || (pe_file && (cs->c_sclass =3D=3D C_STAT))) tmpaddr +=3D ANOFFSET (objfile->section_offsets, sec); =20=20 if (sec =3D=3D SECT_OFF_TEXT (objfile)) ------=_NextPart_000_0181_01C318AD.62D91AB0 Content-Type: text/plain; name="ChangeLog_entry.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ChangeLog_entry.txt" Content-length: 182 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). ------=_NextPart_000_0181_01C318AD.62D91AB0--