aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChenghua Xu <xuchenghua@loongson.cn>2016-10-24 09:31:54 (GMT)
committerChenghua Xu <xuchenghua@loongson.cn>2016-10-26 03:19:45 (GMT)
commite2adbabdfa052937333811e77aac4d90980d868a (patch)
treef990741cb0dfaf9f94c992ef868b0ee1a5e11d45
parent7ceddd13425ef91b8261dd72c99b5d71566fd828 (diff)
downloadbinutils-2.24-e2adbabdfa052937333811e77aac4d90980d868a.zip
binutils-2.24-e2adbabdfa052937333811e77aac4d90980d868a.tar.gz
binutils-2.24-e2adbabdfa052937333811e77aac4d90980d868a.tar.bz2
binutils-2.24: Fix bug from fix-added-two-sync-before-ll-lld.refs/changes/51/1451/1
gas/config/ * tc-mips.c: Bug fixed. Change-Id: I3a88ef3a995ed05a102345a242923756e16deb20
-rw-r--r--gas/config/tc-mips.c50
1 files changed, 16 insertions, 34 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index ff3e9ff..0a23f65 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -3589,7 +3589,6 @@ void
md_assemble (char *str)
{
struct mips_cl_insn insn;
- char *input_line_last;
bfd_reloc_code_real_type unused_reloc[3]
= {BFD_RELOC_UNUSED, BFD_RELOC_UNUSED, BFD_RELOC_UNUSED};
@@ -3625,44 +3624,27 @@ md_assemble (char *str)
static expressionS bak_offset_expr;
static bfd_reloc_code_real_type bak_offset_reloc[3] ;
- if ((strcmp (insn.insn_mo->name, "ll") == 0)
- ||(strcmp (insn.insn_mo->name, "lld") == 0)) {
+ struct insn_label_list *is_label;
+ is_label = seg_info (now_seg)->label_list;
- input_line_last = input_line_pointer;
+ if (((strcmp (insn.insn_mo->name, "ll") == 0)
+ ||(strcmp (insn.insn_mo->name, "lld") == 0))
+ && ( strcmp (history[0].insn_mo->name, "sync") || is_label)) {
+ bak_imm_expr = imm_expr;
+ bak_offset_expr = offset_expr;
- /* Find ll/lld look back */
- do
- input_line_last--;
- while( !(input_line_last[0] == 'l' && input_line_last[1] == 'l'));
+ bak_offset_reloc[0] = offset_reloc[0];
+ bak_offset_reloc[1] = offset_reloc[1];
+ bak_offset_reloc[2] = offset_reloc[2];
- /* Skip space tab semicolon */
- do
- input_line_last--;
- while ( input_line_last[0] == ' ' || input_line_last[0] == '\t' || input_line_last[0] == '\n' || input_line_last[0] == ';');
+ md_assemble("sync");
- /* Check back if next four character is "sync" */
- if (input_line_last[-3] == 's' && input_line_last[-2] == 'y' && input_line_last[-1] == 'n' && input_line_last[0] == 'c')
- {} /* The sync was here, don't added. */
- else
- {
- bak_imm_expr = imm_expr;
- bak_offset_expr = offset_expr;
-
- bak_offset_reloc[0] = offset_reloc[0];
- bak_offset_reloc[1] = offset_reloc[1];
- bak_offset_reloc[2] = offset_reloc[2];
-
- md_assemble("sync");
-
- imm_expr = bak_imm_expr;
- offset_expr = bak_offset_expr;
-
- offset_reloc[0] = bak_offset_reloc[0];
- offset_reloc[1] = bak_offset_reloc[1];
- offset_reloc[2] = bak_offset_reloc[2];
-
- }
+ imm_expr = bak_imm_expr;
+ offset_expr = bak_offset_expr;
+ offset_reloc[0] = bak_offset_reloc[0];
+ offset_reloc[1] = bak_offset_reloc[1];
+ offset_reloc[2] = bak_offset_reloc[2];
}
}