This patch adds TLS support to the FR-V target, within the FDPIC ABI. Because the TLS ABI extension requires annotations such as #tlsmoff(0) to actually generate a relocation for *ABS*+0, I had to tweak cgen asm parsing machinery to enable a fix-up to be generated for expressions that could be handled as a simple numerical value, upon request. As it turned out, this enabled a number of other relocations that used to be simply discarded to be generated properly as well (for some definition of properly, given that say #gotoff(0) doesn't make a lot of sense). The portion of the patch that implements this change in cgen and gas, that I request permission to install, is below. ChangeLog entries are part of the bigger attached patch, and not duplicated in the inline text. The rest, posted for reference, affects only the FRV port of binutils, of which I'm a maintainer, so don't bother to review it unless you feel like it. That said, comments are welcome, especially suggestions on how to better handle the apparent ambiguity between *ABS* and *UND* sections I've run into. Since there are lots of testcases, I had to compress the entire patch, otherwise it would exceed 300KiB. Ok to install the inline bits below? Index: include/opcode/cgen.h =================================================================== RCS file: /cvs/uberbaum/include/opcode/cgen.h,v retrieving revision 1.19 diff -u -p -r1.19 cgen.h --- include/opcode/cgen.h 8 Aug 2003 21:21:24 -0000 1.19 +++ include/opcode/cgen.h 25 Jan 2005 09:38:11 -0000 @@ -369,7 +369,8 @@ enum cgen_parse_operand_type { CGEN_PARSE_OPERAND_INIT, CGEN_PARSE_OPERAND_INTEGER, - CGEN_PARSE_OPERAND_ADDRESS + CGEN_PARSE_OPERAND_ADDRESS, + CGEN_PARSE_OPERAND_SYMBOLIC }; /* Values for indicating what was parsed. */ Index: gas/cgen.c =================================================================== RCS file: /cvs/uberbaum/gas/cgen.c,v retrieving revision 1.24 diff -u -p -r1.24 cgen.c --- gas/cgen.c 25 Jun 2004 16:11:09 -0000 1.24 +++ gas/cgen.c 25 Jan 2005 09:38:40 -0000 @@ -372,6 +372,8 @@ gas_cgen_parse_operand (cd, want, strP, *resultP = CGEN_PARSE_OPERAND_RESULT_ERROR; break; case O_constant: + if (want == CGEN_PARSE_OPERAND_SYMBOLIC) + goto de_fault; *valueP = exp.X_add_number; *resultP = CGEN_PARSE_OPERAND_RESULT_NUMBER; break; @@ -379,6 +381,7 @@ gas_cgen_parse_operand (cd, want, strP, *valueP = exp.X_add_number; *resultP = CGEN_PARSE_OPERAND_RESULT_REGISTER; break; + de_fault: default: queue_fixup (opindex, opinfo, &exp); *valueP = 0;