[PATCH]: Fix HC12 gas to handle indexed addressing mode (Bug savannah/1825)
Stephane Carrez
stcarrez@nerim.fr
Sun Dec 1 03:02:00 GMT 2002
Hi!
The gas HC12 is handling PC-relative addressing modes incorrectly. This is reported in:
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=1825&group_id=2424
This patch fixes that and also improves the assembler to use either a 5, 9 or 16-bit
offset in the case an offset is not yet known at the place it is used (we were always
using a 16-bit offset, even if it was resolved later on). To handle the 'sym1 - sym2'
offset case, I've followed the cris port and provide a specific md_relax_frag.
Committed. Update of gas testsuite to follow.
Stephane
2002-12-01 Stephane Carrez <stcarrez@nerim.fr>
Fix Bug savannah/1825:
* config/tc-m68hc11.h (md_relax_frag): Define to support relaxations
that are not pc-relative.
(m68hc11_relax_frag): Declare.
* config/tc-m68hc11.c (build_indexed_byte): Use a frag_var to handle
the offsetable indexed addressing modes (n,r).
(build_insn): Cleanup some locals.
(m68hc11_relax_frag): New function imported from tc-cris.c to handle
relaxation of difference between two symbols of same section.
(md_convert_frag): For INDEXED_OFFSET relaxs, use the displacement
only when this is a PC-relative operand and the offset is not absolute.
(md_estimate_size_before_relax): Convert the INDEXED_OFFSET,UNDEF frag
to INDEXED_OFFSET,STATE_BITS5 when the symbol is absolute; this will
be handled by m68hc11_relax_frag.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tc-m68hc11.c.diffs
URL: <https://sourceware.org/pipermail/binutils/attachments/20021201/9b9b57b1/attachment.ksh>
More information about the Binutils
mailing list