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]

Use md_number_to_chars for SH relocs


Ok to install?

Index: gas/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* config/tc-sh.c (md_apply_fix) [BFD_RELOC_32, BFD_RELOC_16]: Use
	md_number_to_chars.

Index: gas/config/tc-sh.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-sh.c,v
retrieving revision 1.19
diff -u -p -r1.19 tc-sh.c
--- gas/config/tc-sh.c	2000/07/08 18:13:58	1.19
+++ gas/config/tc-sh.c	2000/08/15 07:14:42
@@ -2681,33 +2681,11 @@ md_apply_fix (fixP, val)
       break;
 
     case BFD_RELOC_32:
-      if (!target_big_endian)
-	{
-	  *buf++ = val >> 0;
-	  *buf++ = val >> 8;
-	  *buf++ = val >> 16;
-	  *buf++ = val >> 24;
-	}
-      else
-	{
-	  *buf++ = val >> 24;
-	  *buf++ = val >> 16;
-	  *buf++ = val >> 8;
-	  *buf++ = val >> 0;
-	}
+      md_number_to_chars (buf, val, 4);
       break;
 
     case BFD_RELOC_16:
-      if (! target_big_endian)
-	{
-	  *buf++ = val >> 0;
-	  *buf++ = val >> 8;
-	}
-      else
-	{
-	  *buf++ = val >> 8;
-	  *buf++ = val >> 0;
-	}
+      md_number_to_chars (buf, val, 2);
       break;
 
     case BFD_RELOC_SH_USES:

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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