This is the mail archive of the binutils@sourceware.org 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]

PATCH: Use printing 32-bit complex reloc values


Hi Guys,

  I am applying the patch below to fix a small problem with the
  code to generate the name of a symbol involved in a complex reloc.
  The problem was that sprintf_vma was being called directly which
  would result in a 64-bit value being put into the reloc if the
  assembler was running on a 64-bit host, even if the target
  architecture was only a 32-bit architecture.  The solution is to use
  the bfd_sprintf_vma function which handles this sort of thing
  correctly.

Cheers
  Nick

gas/ChangeLog
2007-07-04  Nick Clifton  <nickc@redhat.com>

	* symbols.c (symbol_relc_make_value): Use bfd_sprintf_vma in order
	to get the right length of printed value.

Index: gas/symbols.c
===================================================================
RCS file: /cvs/src/src/gas/symbols.c,v
retrieving revision 1.85
diff -c -3 -p -r1.85 symbols.c
*** gas/symbols.c	3 Jul 2007 11:01:03 -0000	1.85
--- gas/symbols.c	4 Jul 2007 11:11:41 -0000
*************** symbol_relc_make_value (offsetT val)
*** 3004,3010 ****
    char * terminal = xmalloc (28);  /* Enough for long long.  */
  
    terminal[0] = '#';
!   sprintf_vma (& terminal[1], val);
    return terminal;
  }
  
--- 3004,3010 ----
    char * terminal = xmalloc (28);  /* Enough for long long.  */
  
    terminal[0] = '#';
!   bfd_sprintf_vma (stdoutput, terminal + 1, val);
    return terminal;
  }
  


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