aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChenghua Xu <xuchenghua@loongson.cn>2016-10-11 03:32:23 (GMT)
committerChenghua Xu <xuchenghua@loongson.cn>2016-10-13 02:44:35 (GMT)
commit7ceddd13425ef91b8261dd72c99b5d71566fd828 (patch)
tree3f30923529b64c2206e94a5fc33175ee9799f4f2
parent46f7aac562604beee54f193de1ca8c383b95cdba (diff)
downloadbinutils-2.24-7ceddd13425ef91b8261dd72c99b5d71566fd828.zip
binutils-2.24-7ceddd13425ef91b8261dd72c99b5d71566fd828.tar.gz
binutils-2.24-7ceddd13425ef91b8261dd72c99b5d71566fd828.tar.bz2
binutils-2.24: Fix added two sync before ll/lld.refs/changes/54/1254/1
If there are sync before ll/lld, don't add sync. gas/config/ * tc-mips.c: Fixed. Change-Id: Ic28254b7a9a086a731605d3d88bc3c177cd6a004
-rw-r--r--gas/config/tc-mips.c44
1 files changed, 33 insertions, 11 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 928f5b4..ff3e9ff 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -3589,6 +3589,7 @@ 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};
@@ -3626,21 +3627,42 @@ md_assemble (char *str)
if ((strcmp (insn.insn_mo->name, "ll") == 0)
||(strcmp (insn.insn_mo->name, "lld") == 0)) {
- 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];
+ input_line_last = input_line_pointer;
- md_assemble("sync");
+ /* Find ll/lld look back */
+ do
+ input_line_last--;
+ while( !(input_line_last[0] == 'l' && input_line_last[1] == 'l'));
- imm_expr = bak_imm_expr;
- offset_expr = bak_offset_expr;
+ /* 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] == ';');
+
+ /* 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];
+
+ }
- offset_reloc[0] = bak_offset_reloc[0];
- offset_reloc[1] = bak_offset_reloc[1];
- offset_reloc[2] = bak_offset_reloc[2];
}
}