A patch for config/tc-i386.c

H . J . Lu hjl@valinux.com
Tue Apr 18 10:49:00 GMT 2000


This patch

2000-04-17  Alan Modra  <alan@linuxcare.com.au>

        * config/tc-i386.c (offset_in_range): Sign extend val so BFD64
        doesn't give spurious errors.

uses bfd_vma. But it won't work for none bfd assemblers like
i386-a.out. addressT is typedefed to bfd_vma for bsd assemblers. I
checked in the following patch to fix it.


-- 
H.J. Lu (hjl@gnu.org)
--
Index: ChangeLog
===================================================================
RCS file: /work/cvs/gnu/binutils/gas/ChangeLog,v
retrieving revision 1.1.1.56
diff -u -p -r1.1.1.56 ChangeLog
--- ChangeLog	2000/04/18 17:05:46	1.1.1.56
+++ ChangeLog	2000/04/18 17:45:01
@@ -1,3 +1,8 @@
+2000-04-18  H.J. Lu  (hjl@gnu.org)
+
+	* config/tc-i386.c (offset_in_range): Use addressT instead of
+	bfd_vma for none bfd assemblers.
+
 2000-04-17  Alan Modra  <alan@linuxcare.com.au>
 
 	* config/tc-i386.c (offset_in_range): Sign extend val so BFD64
Index: config/tc-i386.c
===================================================================
RCS file: /work/cvs/gnu/binutils/gas/config/tc-i386.c,v
retrieving revision 1.20
diff -u -p -r1.20 tc-i386.c
--- config/tc-i386.c	2000/04/18 17:12:39	1.20
+++ config/tc-i386.c	2000/04/18 17:42:28
@@ -465,19 +465,19 @@ offset_in_range (val, size)
      offsetT val;
      int size;
 {
-  bfd_vma mask;
+  addressT mask;
 
   switch (size)
     {
-    case 1: mask = ((bfd_vma) 1 <<  8) - 1; break;
-    case 2: mask = ((bfd_vma) 1 << 16) - 1; break;
-    case 4: mask = ((bfd_vma) 1 << 32) - 1; break;
+    case 1: mask = ((addressT) 1 <<  8) - 1; break;
+    case 2: mask = ((addressT) 1 << 16) - 1; break;
+    case 4: mask = ((addressT) 1 << 32) - 1; break;
     default: abort();
     }
 
   /* If BFD64, sign extend val.  */
-  if ((val & ~ (((bfd_vma) 1 << 32) - 1)) == 0)
-    val = (val ^ ((bfd_vma) 1 << 31)) - ((bfd_vma) 1 << 31);
+  if ((val & ~ (((addressT) 1 << 32) - 1)) == 0)
+    val = (val ^ ((addressT) 1 << 31)) - ((addressT) 1 << 31);
 
   if ((val & ~ mask) != 0 && (val & ~ mask) != ~ mask)
     {


More information about the Binutils mailing list