diff options
author | Arnold Metselaar <arnold.metselaar@planet.nl> | 2010-12-05 21:44:08 +0000 |
---|---|---|
committer | Arnold Metselaar <arnold.metselaar@planet.nl> | 2010-12-05 21:44:08 +0000 |
commit | 761025beb317a952383f080898386095c512c5ab (patch) | |
tree | 7c716cf0c1793b4a79c80104995f051235997f02 /gas/config/tc-z80.c | |
parent | 7353ec481f17a109e657b0842bbd774f9c769bbd (diff) | |
download | gdb-761025beb317a952383f080898386095c512c5ab.zip gdb-761025beb317a952383f080898386095c512c5ab.tar.gz gdb-761025beb317a952383f080898386095c512c5ab.tar.bz2 |
PR gas/12269
* config/tc-z80.c (emit_mx, emit_ldxhl): Do not use
symbol_get_value_expression on a symbol that may not yet have
a value.
* testsuite/gas/z80/atend.s: New file, test case for bug 12269,
provided by Chris Smith.
* testsuite/gas/z80/atend.d: New file, expected results for atend.s.
* testsuite/gas/z80/z80.exp: Run new test case.
Diffstat (limited to 'gas/config/tc-z80.c')
-rw-r--r-- | gas/config/tc-z80.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c index e2ea462..7c13fa7 100644 --- a/gas/config/tc-z80.c +++ b/gas/config/tc-z80.c @@ -769,8 +769,12 @@ emit_mx (char prefix, char opcode, int shift, expressionS * arg) q = frag_more (2); *q++ = (rnum & R_IX) ? 0xDD : 0xFD; *q = (prefix) ? prefix : (opcode + (6 << shift)); - emit_byte (symbol_get_value_expression (arg->X_add_symbol), - BFD_RELOC_Z80_DISP8); + { + expressionS offset = *arg; + offset.X_op = O_symbol; + offset.X_add_number = 0; + emit_byte (&offset, BFD_RELOC_Z80_DISP8); + } if (prefix) { q = frag_more (1); @@ -1598,8 +1602,13 @@ emit_ld (char prefix_in ATTRIBUTE_UNUSED, char opcode_in ATTRIBUTE_UNUSED, switch (dst.X_op) { case O_md1: - emit_ldxhl ((dst.X_add_number & R_IX) ? 0xDD : 0xFD, 0x70, - &src, symbol_get_value_expression (dst.X_add_symbol)); + { + expressionS dst_offset = dst; + dst_offset.X_op = O_symbol; + dst_offset.X_add_number = 0; + emit_ldxhl ((dst.X_add_number & R_IX) ? 0xDD : 0xFD, 0x70, + &src, &dst_offset); + } break; case O_register: |