Add support for .uahword, .uaword and .uaxword pseudo ops
[deliverable/binutils-gdb.git] / gas / config / tc-sparc.c
index dc90f5d79d682ce4139ce66674de8c4f45fa9e48..558dc893f006be4c1e8fcdbf7ad483b0ae18c13d 100644 (file)
@@ -2971,16 +2971,19 @@ md_apply_fix3 (fixP, value, segment)
 
   /* If this is a data relocation, just output VAL.  */
 
-  if (fixP->fx_r_type == BFD_RELOC_16)
+  if (fixP->fx_r_type == BFD_RELOC_16
+      || fixP->fx_r_type == BFD_RELOC_SPARC_UA16)
     {
       md_number_to_chars (buf, val, 2);
     }
   else if (fixP->fx_r_type == BFD_RELOC_32
+          || fixP->fx_r_type == BFD_RELOC_SPARC_UA32
           || fixP->fx_r_type == BFD_RELOC_SPARC_REV32)
     {
       md_number_to_chars (buf, val, 4);
     }
-  else if (fixP->fx_r_type == BFD_RELOC_64)
+  else if (fixP->fx_r_type == BFD_RELOC_64
+          || fixP->fx_r_type == BFD_RELOC_SPARC_UA64)
     {
       md_number_to_chars (buf, val, 8);
     }
@@ -3316,6 +3319,9 @@ tc_gen_reloc (section, fixp)
     case BFD_RELOC_SPARC_LOX10:
     case BFD_RELOC_SPARC_REV32:
     case BFD_RELOC_SPARC_OLO10:
+    case BFD_RELOC_SPARC_UA16:
+    case BFD_RELOC_SPARC_UA32:
+    case BFD_RELOC_SPARC_UA64:
     case BFD_RELOC_VTABLE_ENTRY:
     case BFD_RELOC_VTABLE_INHERIT:
       code = fixp->fx_r_type;
@@ -4066,12 +4072,9 @@ sparc_cons_align (nbytes)
   if (! enforce_aligned_data)
     return;
 
+  /* Don't align if this is an unaligned pseudo-op.  */
   if (sparc_no_align_cons)
-    {
-      /* This is an unaligned pseudo-op.  */
-      sparc_no_align_cons = 0;
-      return;
-    }
+    return;
 
   nalign = log2 (nbytes);
   if (nalign == 0)
@@ -4196,9 +4199,23 @@ cons_fix_new_sparc (frag, where, nbytes, exp)
        (nbytes == 2 ? BFD_RELOC_16 :
        (nbytes == 4 ? BFD_RELOC_32 : BFD_RELOC_64)));
 
-  if (target_little_endian_data && nbytes == 4
+  if (target_little_endian_data
+      && nbytes == 4
       && now_seg->flags & SEC_ALLOC)
     r = BFD_RELOC_SPARC_REV32;
+
+  if (sparc_no_align_cons)
+    {
+      switch (nbytes)
+       {
+       case 2: r = BFD_RELOC_SPARC_UA16; break;
+       case 4: r = BFD_RELOC_SPARC_UA32; break;
+       case 8: r = BFD_RELOC_SPARC_UA64; break;
+       default: abort ();
+       }
+      sparc_no_align_cons = 0;
+    }
+
   fix_new_exp (frag, where, (int) nbytes, exp, 0, r);
 }
 
This page took 0.02485 seconds and 4 git commands to generate.