This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Fix a bug of Blackfin gas
- From: Jie Zhang <jie dot zhang at analog dot com>
- To: binutils <binutils at sourceware dot org>
- Date: Thu, 24 Jul 2008 15:20:17 +0800
- Subject: [PATCH] Fix a bug of Blackfin gas
For an assembly file only containing the following line:
r1 = [p0 + FOO];
Blackfin gas has an internal error:
bfin-linux-uclibc-as: BFD (GNU Binutils) 2.18.50.20080722 internal
error, aborting at ../../binutils/gas/config/tc-bfin.c line 1447 in
bfin_gen_ldstidxi
bfin-linux-uclibc-as: Please report this bug.
For Blackfin, the only valid symbol which can be as an offset in
load/store instruction is "_current_shared_library_p5_offset_". Other
symbol appearing in that place usually is a program error. I'm
committing the attached patch to fix it.
Jie
* config/bfin-parse.y (asm_1): Error if plain symbol is used
as load/store offset.
Index: config/bfin-parse.y
===================================================================
RCS file: /cvs/src/src/gas/config/bfin-parse.y,v
retrieving revision 1.16
diff -u -p -r1.16 bfin-parse.y
--- config/bfin-parse.y 26 Mar 2008 16:21:10 -0000 1.16
+++ config/bfin-parse.y 24 Jul 2008 07:03:09 -0000
@@ -3202,6 +3202,11 @@ asm_1:
if (!IS_DREG ($1) && !ispreg)
return yyerror ("Bad destination register for LOAD");
+ if (tmp->type == Expr_Node_Reloc
+ && strcmp (tmp->value.s_value,
+ "_current_shared_library_p5_offset_") != 0)
+ return yyerror ("Plain symbol used as offset");
+
if ($5.r0)
tmp = unary (Expr_Op_Type_NEG, tmp);