This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS %half in gas


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]