From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4779 invoked by alias); 23 Mar 2005 16:07:49 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 3915 invoked from network); 23 Mar 2005 16:06:54 -0000 Received: from unknown (HELO webmail.streamline-computing.com) (82.133.39.164) by sourceware.org with SMTP; 23 Mar 2005 16:06:54 -0000 Received: from [82.133.39.162] (helo=delmo.priv.wark.uk.streamline-computing.com) by webmail.streamline-computing.com with asmtp (Exim 3.35 #1 (Debian)) id 1DE8OD-0003Sx-00; Wed, 23 Mar 2005 16:07:25 +0000 Subject: Re: XCOFF 64 function address wrong? From: David Lecomber To: Nick Clifton Cc: binutils@sources.redhat.com In-Reply-To: <42317797.4030002@redhat.com> References: <1110356435.7150.2.camel@cpc2-oxfd5-5-0-cust103.oxfd.cable.ntl.com> <422EF4B5.2000204@redhat.com> <1110380006.22694.60.camel@delmo.priv.wark.uk.streamline-computing.com> <422F1B92.6000502@redhat.com> <1110390657.8240.13.camel@delmo.priv.wark.uk.streamline-computing.com> <4230228C.5080900@redhat.com> <1110492249.16516.8.camel@cpc2-oxfd5-5-0-cust103.oxfd.cable.ntl.com> <42317797.4030002@redhat.com> Content-Type: text/plain Date: Thu, 24 Mar 2005 02:03:00 -0000 Message-Id: <1111593934.6362.27.camel@delmo.priv.wark.uk.streamline-computing.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2005-03/txt/msg00717.txt.bz2 Hi Nick Sorry for the delay -- our p615 decided to clean its hard disk... This revised fix does indeed resolve the problems: output is now as the full 64-bit address. I have compiled this without the --enable-64-bit- bfd - is this flag necessary these days? Regards David On Fri, 2005-03-11 at 10:48 +0000, Nick Clifton wrote: > Hi David, > > > This fixes partially the problem -- the .main is properly addressed -- > > but the line numbering list remains truncated -- this being the > > 1 : 0x43c bit: > > Ah yes. Please try this revised patch (instead of the previous one, > rather than in addition to it). > > Cheers > Nick > > > plain text document attachment (coffgen.c.patch) > Index: bfd/coffgen.c > =================================================================== > RCS file: /cvs/src/src/bfd/coffgen.c,v > retrieving revision 1.48 > diff -c -3 -p -r1.48 coffgen.c > *** bfd/coffgen.c 21 Feb 2005 11:21:29 -0000 1.48 > --- bfd/coffgen.c 11 Mar 2005 10:35:38 -0000 > *************** coff_print_symbol (abfd, filep, symbol, > *** 1991,2018 **** > else > val = combined->u.syment.n_value - (unsigned long) root; > > - #ifndef XCOFF64 > fprintf (file, > ! "(sec %2d)(fl 0x%02x)(ty %3x)(scl %3d) (nx %d) 0x%08lx %s", > combined->u.syment.n_scnum, > combined->u.syment.n_flags, > combined->u.syment.n_type, > combined->u.syment.n_sclass, > ! combined->u.syment.n_numaux, > ! (unsigned long) val, > ! symbol->name); > ! #else > ! /* Print out the wide, 64 bit, symbol value */ > ! fprintf (file, > ! "(sec %2d)(fl 0x%02x)(ty %3x)(scl %3d) (nx %d) 0x%016llx %s", > ! combined->u.syment.n_scnum, > ! combined->u.syment.n_flags, > ! combined->u.syment.n_type, > ! combined->u.syment.n_sclass, > ! combined->u.syment.n_numaux, > ! val, > ! symbol->name); > ! #endif > > for (aux = 0; aux < combined->u.syment.n_numaux; aux++) > { > --- 1991,2019 ---- > else > val = combined->u.syment.n_value - (unsigned long) root; > > fprintf (file, > ! "(sec %2d)(fl 0x%02x)(ty %3x)(scl %3d) (nx %d) ", > combined->u.syment.n_scnum, > combined->u.syment.n_flags, > combined->u.syment.n_type, > combined->u.syment.n_sclass, > ! combined->u.syment.n_numaux); > ! > ! /* We used to test for XCOFF64 being defined here in order to > ! determine whether we are displaying 64-bit or 32-bit symbol > ! values. But this does not work because XCOFF64 is only defined > ! in coff64-rs6000.c just before it includes coffcode.h. Instead > ! we check the symbols's value and see if any of the top 32 bits > ! are set. This is not ideal since it can lead to mixed styles > ! in the output, but it does at least mean that 64-bit symbols will > ! not be displayed in a truncated fashion. */ > ! if (val <= 0xFFFFFFFFULL) > ! fprintf (file, "0x%08lx", (unsigned long) val); > ! else > ! /* Print out the wide, 64 bit, symbol value. */ > ! fprintf (file, "0x%016llx", val); > ! > ! fprintf (file, " %s", symbol->name); > > for (aux = 0; aux < combined->u.syment.n_numaux; aux++) > { > *************** coff_print_symbol (abfd, filep, symbol, > *** 2091,2100 **** > l++; > while (l->line_number) > { > ! fprintf (file, "\n%4d : 0x%lx", > ! l->line_number, > ! ((unsigned long) > ! (l->u.offset + symbol->section->vma))); > l++; > } > } > --- 2092,2107 ---- > l++; > while (l->line_number) > { > ! fprintf (file, "\n%4d : ", l->line_number); > ! > ! val = l->u.offset + symbol->section->vma; > ! > ! /* See comment about XCOFF64 above. */ > ! if (val <= 0xFFFFFFFFULL) > ! fprintf (file, "0x%lx", (unsigned long) val); > ! else > ! fprintf (file, "0x%llx", val); > ! > l++; > } > } -- David Lecomber