This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
SPU gas reloc fix
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sourceware dot org
- Date: Fri, 4 Jul 2008 22:36:14 +0930
- Subject: SPU gas reloc fix
Fixes assembly errors for code that can be generated by gcc, at least
in the case of HI16 and LO16.
* config/tc-spu.c (md_apply_fix): Handle fully resolved
BFD_RELOC_32_PCREL, BFD_RELOC_SPU_HI16 and BFD_RELOC_SPU_LO16.
Index: gas/config/tc-spu.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-spu.c,v
retrieving revision 1.10
diff -u -p -r1.10 tc-spu.c
--- gas/config/tc-spu.c 17 Oct 2007 16:45:55 -0000 1.10
+++ gas/config/tc-spu.c 4 Jul 2008 05:11:48 -0000
@@ -964,6 +964,7 @@ md_apply_fix (fixS *fixP, valueT *valP,
return;
case BFD_RELOC_32:
+ case BFD_RELOC_32_PCREL:
md_number_to_chars (place, val, 4);
return;
@@ -1011,6 +1012,14 @@ md_apply_fix (fixS *fixP, valueT *valP,
res = (val & 0x3fffc) << 5;
break;
+ case BFD_RELOC_SPU_HI16:
+ res = (val >> 9) & 0x7fff80;
+ break;
+
+ case BFD_RELOC_SPU_LO16:
+ res = (val << 7) & 0x7fff80;
+ break;
+
default:
as_bad_where (fixP->fx_file, fixP->fx_line,
_("reloc %d not supported by object file format"),
--
Alan Modra
Australia Development Lab, IBM