[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mips-elf-as error "Error: unclosed '('"
From: |
Nick Clifton |
Subject: |
Re: mips-elf-as error "Error: unclosed '('" |
Date: |
04 Feb 2003 15:29:57 +0000 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 |
Hi Fred,
> I just built a mips-elf toolchain from the latest CVS sources and am now
> getting errors trying to build newlib. Here is an example:
>
> $ cat bug.s
> .text
> li $2, ((0x20000000|0x00100000)-((0x20000000|0x00100000)&0x20000000))
> $ ./as-new bug.s
> bug.s: Assembler messages:
> bug.s:2: Error: unclosed '('
> bug.s:2: Error: unclosed '('
Indeed. The patch fixes the problem, although I am not sure if it is
correct. The code in my_getSmallExpression() is not completely clear.
It appears to be trying to extract %-delimitered reloc commands from
an expression string, but I do not know if the expressions associated
with these relocs can be as complicated as the one in your test case.
Perhaps the MIPS maintainer (hi Eric!) can have a look ?
Cheers
Nick
2003-02-04 Nick Clifton <address@hidden>
* config/tc-mips.c (my_getSmallExpression): Only skip opening
parentheses if a %-delimitered reloc is encountered.
Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.190
diff -c -3 -p -w -r1.190 tc-mips.c
*** gas/config/tc-mips.c 2 Feb 2003 19:37:20 -0000 1.190
--- gas/config/tc-mips.c 4 Feb 2003 15:10:30 -0000
*************** my_getSmallExpression (ep, reloc, str)
*** 10019,10026 ****
char *str;
{
bfd_reloc_code_real_type reversed_reloc[3];
! size_t reloc_index, i;
int bracket_depth;
reloc_index = 0;
bracket_depth = 0;
--- 10019,10027 ----
char *str;
{
bfd_reloc_code_real_type reversed_reloc[3];
! size_t reloc_index;
int bracket_depth;
+ char * saved_str = str;
reloc_index = 0;
bracket_depth = 0;
*************** my_getSmallExpression (ep, reloc, str)
*** 10041,10046 ****
--- 10042,10056 ----
break;
}
+ reloc[0] = BFD_RELOC_LO16;
+
+ if (reloc_index == 0)
+ my_getExpression (ep, str);
+
+ else
+ {
+ size_t i;
+
my_getExpression (ep, str);
str = expr_end;
*************** my_getSmallExpression (ep, reloc, str)
*** 10054,10062 ****
expr_end = str;
- reloc[0] = BFD_RELOC_LO16;
for (i = 0; i < reloc_index; i++)
reloc[i] = reversed_reloc[reloc_index - 1 - i];
return reloc_index;
}
--- 10064,10072 ----
expr_end = str;
for (i = 0; i < reloc_index; i++)
reloc[i] = reversed_reloc[reloc_index - 1 - i];
+ }
return reloc_index;
}