This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: XCOFF 64 function address wrong?


Hi Nick,

Finally got the chance to check this one, and I can confirm that this
works and has resolved the failure to print 64-bit addresses on AIX 5.2

Thanks again for the patch,

Regards
David
On Mon, 2005-04-04 at 17:16 +0100, Nick Clifton wrote:
> Hi David,
> 
> > This revised fix does indeed resolve the problems: output is now as the
> > full 64-bit address.
> 
> Bad news - the patch does not work.  Or rather it introduces a compile 
> time warning message for some build environments and since we are now 
> compiling with -Werror specified this stops the build.
> 
> The good news however is that I have a simpler patch which I think 
> should do the right thing (tm).
> 
> Please could you try it and let me know if it works for you ?
> 
> Cheers
>    Nick
> 
> bfd/ChangeLog
> 2005-04-04  Nick Clifton  <nickc@redhat.com>
> 
> 	* coffgen.c (coff_print_symbol): Use fprintf_vma to print a vma.
> 
> plain text document attachment (coffgen.c.patch)
> Index: bfd/coffgen.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/coffgen.c,v
> retrieving revision 1.49
> diff -c -3 -p -r1.49 coffgen.c
> *** bfd/coffgen.c	22 Mar 2005 16:14:41 -0000	1.49
> --- bfd/coffgen.c	4 Apr 2005 16:15:59 -0000
> *************** coff_print_symbol (bfd *abfd,
> *** 1895,1922 ****
>   	  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++)
>   	    {
> --- 1895,1908 ----
>   	  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);
> ! 	  fprintf_vma (file, val);
> ! 	  fprintf (file, " %s", symbol->name);
>   
>   	  for (aux = 0; aux < combined->u.syment.n_numaux; aux++)
>   	    {
> *************** coff_print_symbol (bfd *abfd,
> *** 1995,2004 ****
>   	      l++;
>   	      while (l->line_number)
>   		{
> ! 		  fprintf (file, "\n%4d : 0x%lx",
> ! 			   l->line_number,
> ! 			   ((unsigned long)
> ! 			    (l->u.offset + symbol->section->vma)));
>   		  l++;
>   		}
>   	    }
> --- 1981,1988 ----
>   	      l++;
>   	      while (l->line_number)
>   		{
> ! 		  fprintf (file, "\n%4d : ", l->line_number);
> ! 		  fprintf_vma (file, l->u.offset + symbol->section->vma);
>   		  l++;
>   		}
>   	    }
-- 
David Lecomber, 
Software Director,                    http://www.allinea.com
Allinea Software                      +44 1926 623231



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]