This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: m68hc11 - bug found with MOVW oprx16_xysp, oprx16_xysp1
- From: Stephane Carrez <stephane dot carrez at gmail dot com>
- To: James Murray <jsm at jsm-net dot demon dot co dot uk>
- Cc: binutils at sourceware dot org, skeys at ipdatasys dot com
- Date: Wed, 7 Nov 2012 08:44:59 +0100
- Subject: Re: m68hc11 - bug found with MOVW oprx16_xysp, oprx16_xysp1
- References: <1352247519.2469.15.camel@jsm2>
Hi!
On Wed, Nov 7, 2012 at 1:18 AM, James Murray <jsm@jsm-net.demon.co.uk> wrote:
> I believe it to be caused by this section of code in
> gas/config/tc-m68hc11.c:2225
>
> if ((mode & M6812_OP_IDX) && (current_architecture & cpu9s12x))
> {
> /* Must treat as a 16bit relocate as size of final result is
> unknown. */
>
> byte <<= 3;
> byte |= 0xe2;
> number_to_chars_bigendian (f, byte, 1);
> fix_new (frag_now, f - frag_now->fr_literal, 2,
> sym, off, 0, BFD_RELOC_M68HC12_16B);
> f = frag_more (2);
> return 1;
> }
Yes, there is a problem here. frag_more(2) must be called before fix_new().
Regards,
Stephane