forked from Imagelibrary/binutils-gdb
PowerPC: implement md_operand to parse register names
Allows register names to appear in symbol assignments, so for example tocp = %r2 mr %r3,tocp now assembles. * gas/config/tc-ppc.c (REG_NAME_CNT): Delete, replace uses with ARRAY_SIZE. (register_name): Rename to.. (md_operand): ..this. Only handle %reg. (cr_names): Rename to.. (cr_cond): ..this. Just keep conditions. (ppc_parse_name): Add mode param. Search both cr_cond and pre_defined_registers. Handle absolute and register symbol values here rather than in expr.c:operand(). (md_assemble): Don't special case register name matching in operands, except to set cr_operand as appropriate. * gas/config/tc-ppc.h (md_operand): Don't define. (md_parse_name, ppc_parse_name): Update. * read.c (pseudo_set): Copy over entire O_register value. * testsuite/gas/ppc/regsyms.d. * testsuite/gas/ppc/regsyms.s: New test. * testsuite/gas/ppc/ppc.exp: Run it.
This commit is contained in:
@@ -3934,10 +3934,9 @@ pseudo_set (symbolS *symbolP)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
symbol_set_value_expression (symbolP, &exp);
|
||||
S_SET_SEGMENT (symbolP, reg_section);
|
||||
S_SET_VALUE (symbolP, (valueT) exp.X_add_number);
|
||||
set_zero_frag (symbolP);
|
||||
symbol_get_value_expression (symbolP)->X_op = O_register;
|
||||
break;
|
||||
|
||||
case O_symbol:
|
||||
|
||||
Reference in New Issue
Block a user