aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-sparc.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2001-05-28 09:23:54 +0000
committerNick Clifton <nickc@redhat.com>2001-05-28 09:23:54 +0000
commit0f2712edc99c8717cd41a05b6fede5ba9ff8b35d (patch)
tree393fbe4e8d50197c60c94210e08ed34f14d1adb4 /gas/config/tc-sparc.c
parentc04a062df3a62d69cdf5e75fe01c5cd3dec4435e (diff)
downloadgdb-0f2712edc99c8717cd41a05b6fede5ba9ff8b35d.zip
gdb-0f2712edc99c8717cd41a05b6fede5ba9ff8b35d.tar.gz
gdb-0f2712edc99c8717cd41a05b6fede5ba9ff8b35d.tar.bz2
Add support for .uahword, .uaword and .uaxword pseudo ops
Diffstat (limited to 'gas/config/tc-sparc.c')
-rw-r--r--gas/config/tc-sparc.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index dc90f5d..558dc89 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -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);
}