m68hc11 - bug found with MOVW oprx16_xysp, oprx16_xysp1

Stephane Carrez stephane.carrez@gmail.com
Wed Nov 7 07:45:00 GMT 2012


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



More information about the Binutils mailing list