aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-bfin.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-10-11 08:35:53 +0000
committerMike Frysinger <vapier@gentoo.org>2010-10-11 08:35:53 +0000
commit71ef6f79bc8926dfd6e1b49456a67795af9e2069 (patch)
tree10ecb0230a0492a3ccebf9fed38d3120a316ab55 /gas/config/tc-bfin.c
parent71c5244065e828285f1111b8dc6e2219f3bf9eae (diff)
downloadgdb-71ef6f79bc8926dfd6e1b49456a67795af9e2069.zip
gdb-71ef6f79bc8926dfd6e1b49456a67795af9e2069.tar.gz
gdb-71ef6f79bc8926dfd6e1b49456a67795af9e2069.tar.bz2
gas: blackfin: fix LOOP_BEGIN/LOOP_END pseudo insns handling of local labels
The current LOOP_BEGIN/LOOP_END pseudo insns hit "Internal errors" when using local labels as the loop names due to attempts at removing them. Signed-off-by: David Gibson <david.gibson@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'gas/config/tc-bfin.c')
-rw-r--r--gas/config/tc-bfin.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c
index ccd14cb..e854dce 100644
--- a/gas/config/tc-bfin.c
+++ b/gas/config/tc-bfin.c
@@ -1874,6 +1874,7 @@ bfin_gen_loop (Expr_Node *exp, REG_T reg, int rop, REG_T preg)
char *lbeginsym, *lendsym;
Expr_Node_Value lbeginval, lendval;
Expr_Node *lbegin, *lend;
+ symbolS *sym;
loopsym = exp->value.s_value;
lbeginsym = (char *) xmalloc (strlen (loopsym) + strlen ("__BEGIN") + 5);
@@ -1896,9 +1897,11 @@ bfin_gen_loop (Expr_Node *exp, REG_T reg, int rop, REG_T preg)
lbegin = Expr_Node_Create (Expr_Node_Reloc, lbeginval, NULL, NULL);
lend = Expr_Node_Create (Expr_Node_Reloc, lendval, NULL, NULL);
- symbol_remove (symbol_find (loopsym), &symbol_rootP, &symbol_lastP);
+ sym = symbol_find(loopsym);
+ if (!S_IS_LOCAL (sym) || (S_IS_LOCAL (sym) && !symbol_used_p (sym)))
+ symbol_remove (sym, &symbol_rootP, &symbol_lastP);
- return bfin_gen_loopsetup(lbegin, reg, rop, lend, preg);
+ return bfin_gen_loopsetup (lbegin, reg, rop, lend, preg);
}
void