This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: MIPS %half in gas
- From: Thiemo Seufer <ths at networkno dot de>
- To: binutils at sourceware dot org
- Date: Fri, 12 Oct 2007 18:48:28 +0100
- Subject: Re: MIPS %half in gas
- References: <1096932306.3676.43.camel@localhost.localdomain> <20041005014927.GA26907@nevyn.them.org> <20071012154340.GC9046@caradoc.them.org>
Daniel Jacobowitz wrote:
[snip]
> 2007-10-12 Daniel Jacobowitz <dan@codesourcery.com>
>
> * config/tc-mips.c (append_insn): Handle BFD_RELOC_16.
> (md_apply_fix): Likewise.
>
> 2007-10-12 Daniel Jacobowitz <dan@codesourcery.com>
>
> * gas/mips/half.d, gas/mips/half.s: New.
> * gas/mips/mips.exp: Run %half test.
>
> Index: config/tc-mips.c
> ===================================================================
> RCS file: /cvs/src/src/gas/config/tc-mips.c,v
> retrieving revision 1.376
> diff -u -p -r1.376 tc-mips.c
> --- config/tc-mips.c 8 Oct 2007 16:09:34 -0000 1.376
> +++ config/tc-mips.c 12 Oct 2007 15:41:19 -0000
> @@ -2742,6 +2742,15 @@ append_insn (struct mips_cl_insn *ip, ex
> ip->insn_opcode |= (address_expr->X_add_number >> 16) & 0xffff;
> break;
>
> + case BFD_RELOC_16:
> + if (address_expr->X_add_number & ~0xffffull)
> + {
> + char value [32];
> +
> + sprintf_vma (value, offset_expr.X_add_number);
> + as_bad (_("Number (0x%s) larger than 16 bits"), value);
> + }
> + /* FALLTHROUGH */
> case BFD_RELOC_UNUSED:
> case BFD_RELOC_LO16:
> case BFD_RELOC_MIPS_GOT_DISP:
> @@ -11925,7 +11934,6 @@ md_apply_fix (fixS *fixP, valueT *valP,
>
> case BFD_RELOC_RVA:
> case BFD_RELOC_32:
> - case BFD_RELOC_16:
> /* If we are deleting this reloc entry, we must fill in the
> value now. This can happen if we have a .word which is not
> resolved when it appears but is later defined. */
> @@ -11933,6 +11941,27 @@ md_apply_fix (fixS *fixP, valueT *valP,
> md_number_to_chars ((char *) buf, *valP, fixP->fx_size);
> break;
>
> + case BFD_RELOC_16:
> + /* If we are deleting this reloc entry, we must fill in the
> + value now. This can happen if we have a .word which is not
That's .hword or .short then, I think. Otherwise ok, thanks for
fixing this. :-)
Thiemo