* config/tc-s390.c (s390_elf_cons): Correct fixups for PLT
[deliverable/binutils-gdb.git] / gas / config / tc-sparc.c
index dc90f5d79d682ce4139ce66674de8c4f45fa9e48..a0a1d31b4e1175e60865107f37ee7c91d9874f52 100644 (file)
@@ -632,12 +632,12 @@ md_show_usage (stream)
        continue;
       if (arch != &sparc_arch_table[0])
        fprintf (stream, " | ");
-      if (column + strlen(arch->name) > 70)
+      if (column + strlen (arch->name) > 70)
        {
          column = 0;
          fputc ('\n', stream);
        }
-      column += 5 + 2 + strlen(arch->name);
+      column += 5 + 2 + strlen (arch->name);
       fprintf (stream, "-A%s", arch->name);
     }
   for (arch = &sparc_arch_table[0]; arch->name; arch++)
@@ -645,12 +645,12 @@ md_show_usage (stream)
       if (!arch->user_option_p)
        continue;
       fprintf (stream, " | ");
-      if (column + strlen(arch->name) > 65)
+      if (column + strlen (arch->name) > 65)
        {
          column = 0;
          fputc ('\n', stream);
        }
-      column += 5 + 7 + strlen(arch->name);
+      column += 5 + 7 + strlen (arch->name);
       fprintf (stream, "-xarch=%s", arch->name);
     }
   fprintf (stream, _("\n\
@@ -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;
@@ -3914,6 +3920,7 @@ s_uacons (bytes)
   /* Tell sparc_cons_align not to align this value.  */
   sparc_no_align_cons = 1;
   cons (bytes);
+  sparc_no_align_cons = 0;
 }
 
 /* This handles the native word allocation pseudo-op .nword.
@@ -4066,12 +4073,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 +4200,22 @@ 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 ();
+       }
+   }
+
   fix_new_exp (frag, where, (int) nbytes, exp, 0, r);
 }
 
This page took 0.024413 seconds and 4 git commands to generate.