public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: Support 64bit BFD for m68k and xtensa
@ 2005-04-09 20:48 H. J. Lu
  2005-04-10 16:39 ` PATCH: Support 64bit BFD and 64bit host for xtensa H. J. Lu
  0 siblings, 1 reply; 7+ messages in thread
From: H. J. Lu @ 2005-04-09 20:48 UTC (permalink / raw)
  To: binutils; +Cc: bob.wilson, bje

m68k and xtensa are failed to build with --enable-64-bit-bfd. This
patch fixes it.


H.J.
----
2005-04-09  H.J. Lu  <hongjiu.lu@intel.com>

	* config/tc-m68k.c (get_num): Support 64bit BFD.
	* config/tc-xtensa.c (xg_translate_sysreg_op): Likewise.
	(xtensa_translate_old_userreg_ops): Likewise.
	(xtensa_find_unaligned_branch_targets): Likewise.
	(xtensa_find_unaligned_loops): Likewise.
	(xtensa_fix_close_loop_end_frags): Likewise.
	(relax_frag_add_nop): Likewise.
	(xtensa_move_literals): Likewise.

--- gas/config/tc-m68k.c.error	2005-03-21 09:13:23.000000000 -0800
+++ gas/config/tc-m68k.c	2005-04-09 12:12:10.000000000 -0700
@@ -5292,7 +5292,7 @@ get_num (struct m68k_exp *exp, int ok)
 	  subs (exp) = 0;
 	  offs (exp) = (ok == 10) ? 1 : 0;
 	  as_warn (_("Can't deal with expression; defaulting to %ld"),
-		   offs (exp));
+		   (long) offs (exp));
 	}
     }
   else
@@ -5304,7 +5304,7 @@ get_num (struct m68k_exp *exp, int ok)
 	  subs (exp) = 0;
 	  offs (exp) = (ok == 10) ? 1 : 0;
 	  as_warn (_("Can't deal with expression; defaulting to %ld"),
-		   offs (exp));
+		   (long) offs (exp));
 	}
     }
 
--- gas/config/tc-xtensa.c.error	2005-04-08 15:29:40.000000000 -0700
+++ gas/config/tc-xtensa.c	2005-04-09 13:33:43.000000000 -0700
@@ -2247,7 +2247,7 @@ xg_translate_sysreg_op (char **popname, 
       if (sr == XTENSA_UNDEFINED)
 	{
 	  as_bad (_("invalid register number (%ld) for '%s' instruction"),
-		  val, opname);
+		  (long) val, opname);
 	  return -1;
 	}
     }
@@ -2316,7 +2316,7 @@ xtensa_translate_old_userreg_ops (char *
       if (sr == XTENSA_UNDEFINED)
 	{
 	  as_bad (_("invalid register number (%ld) for '%s'"),
-		  val, opname);
+		  (long) val, opname);
 	  return -1;
 	}
     }
@@ -4882,7 +4882,7 @@ xtensa_find_unaligned_branch_targets (bf
 	      if (frag_addr + op_size > branch_align)
 		as_warn_where (frag->fr_file, frag->fr_line,
 			       _("unaligned branch target: %d bytes at 0x%lx"),
-			       op_size, frag->fr_address);
+			       op_size, (long) frag->fr_address);
 	    }
 	  frag = frag->fr_next;
 	}
@@ -4921,7 +4921,7 @@ xtensa_find_unaligned_loops (bfd *abfd A
 	      if (frag_addr + op_size > xtensa_fetch_width)
 		as_warn_where (frag->fr_file, frag->fr_line,
 			       _("unaligned loop: %d bytes at 0x%lx"),
-			       op_size, frag->fr_address);
+			       op_size, (long) frag->fr_address);
 	    }
 	  frag = frag->fr_next;
 	}
@@ -7462,7 +7462,7 @@ xtensa_fix_close_loop_end_frags (void)
 			  
 			  if (fragP->fr_var < length)
 			    as_fatal (_("fr_var %lu < length %d"),
-				      fragP->fr_var, length);
+				      (long) fragP->fr_var, length);
 			  else
 			    {
 			      assemble_nop (length,
@@ -8410,7 +8410,8 @@ relax_frag_add_nop (fragS *fragP)
 
   if (fragP->fr_var < length)
     {
-      as_fatal (_("fr_var (%ld) < length (%d)"), fragP->fr_var, length);
+      as_fatal (_("fr_var (%ld) < length (%d)"),
+		(long) fragP->fr_var, length);
       return 0;
     }
 
@@ -9872,14 +9873,14 @@ xtensa_move_literals (void)
 	      /* Note that we set this fr_var to be a fix
 		 chain when we created the literal pool location
 		 as RELAX_LITERAL_POOL_BEGIN.  */
-	      frchain_to = (frchainS *) literal_pool->fr_var;
+	      frchain_to = (frchainS *) (unsigned long) literal_pool->fr_var;
 	    }
 	  insert_after = literal_pool;
 
 	  while (insert_after->fr_next->fr_subtype != RELAX_LITERAL_POOL_END)
 	    insert_after = insert_after->fr_next;
 
-	  dest_seg = (segT) insert_after->fr_next->fr_var;
+	  dest_seg = (segT) (unsigned long) insert_after->fr_next->fr_var;
 
 	  *frag_splice = next_frag;
 	  search_frag->fr_next = insert_after->fr_next;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* PATCH: Support 64bit BFD and 64bit host for xtensa
  2005-04-09 20:48 PATCH: Support 64bit BFD for m68k and xtensa H. J. Lu
@ 2005-04-10 16:39 ` H. J. Lu
  2005-04-10 20:15   ` Andreas Schwab
  2005-04-11 16:58   ` Bob Wilson
  0 siblings, 2 replies; 7+ messages in thread
From: H. J. Lu @ 2005-04-10 16:39 UTC (permalink / raw)
  To: binutils; +Cc: bob.wilson

On Sat, Apr 09, 2005 at 01:48:35PM -0700, H. J. Lu wrote:
> m68k and xtensa are failed to build with --enable-64-bit-bfd. This
> patch fixes it.
> 

It turns out that xtensa doesn't support 64bit BFD on 32bit host
nor 64bit host. xtensa passes pointer as int to frag_variant, where
it is stored as offsetT. This patch changes int to long.


H.J.
----
2005-04-10  H.J. Lu  <hongjiu.lu@intel.com>

	* frags.c (frag_variant): Change type of var from int to long.
	* frags.h (frag_variant): Updated.

	* config/tc-i960.c (get_cdisp): Updated call to frag_variant.
	* config/tc-m68hc11.c (build_jump_insn): Likewise.
	* config/tc-msp430.c (msp430_operands): Likewise.
	* config/tc-xtensa.c (xtensa_mark_literal_pool_location): Likewise.
	(xg_assemble_vliw_tokens): Likewise.

	* config/tc-xtensa.c (xg_translate_sysreg_op): Likewise.
	(xtensa_translate_old_userreg_ops): Likewise.
	(xtensa_find_unaligned_branch_targets): Likewise.
	(xtensa_find_unaligned_loops): Likewise.
	(xtensa_fix_close_loop_end_frags): Likewise.
	(relax_frag_add_nop): Likewise.
	(xtensa_move_literals): Likewise.

--- gas/config/tc-i960.c.64bit	2005-03-25 10:18:49.000000000 -0800
+++ gas/config/tc-i960.c	2005-04-10 09:21:12.216332749 -0700
@@ -599,7 +599,7 @@ get_cdisp (char *dispP, /* Displacement 
 	    {
 	      outP = frag_more (8);	/* Allocate worst-case storage.  */
 	      md_number_to_chars (outP, instr, 4);
-	      frag_variant (rs_machine_dependent, 4, 4, 1,
+	      frag_variant (rs_machine_dependent, 4, 4L, 1,
 			    adds (e), offs (e), outP);
 	    }
 	  else
--- gas/config/tc-m68hc11.c.64bit	2005-02-24 12:47:34.000000000 -0800
+++ gas/config/tc-m68hc11.c	2005-04-10 09:21:19.773352892 -0700
@@ -1685,7 +1685,7 @@ build_jump_insn (struct m68hc11_opcode *
 	  opcode = m68hc11_new_insn (3);
 	  number_to_chars_bigendian (opcode, code, 1);
 	  number_to_chars_bigendian (opcode + 1, 0, 1);
-	  frag_variant (rs_machine_dependent, 1, 1,
+	  frag_variant (rs_machine_dependent, 1, 1L,
                         ENCODE_RELAX (STATE_PC_RELATIVE, STATE_UNDF),
                         operands[0].exp.X_add_symbol, (offsetT) n,
                         opcode);
--- gas/config/tc-msp430.c.64bit	2005-02-24 12:47:35.000000000 -0800
+++ gas/config/tc-msp430.c	2005-04-10 09:21:31.924777316 -0700
@@ -1695,7 +1695,7 @@ msp430_operands (struct msp430_opcode_s 
 
 	      frag = frag_more (8);
 	      bfd_putl16 ((bfd_vma) rc.sop, frag);
-	      frag = frag_variant (rs_machine_dependent, 8, 2,
+	      frag = frag_variant (rs_machine_dependent, 8, 2L,
 				   ENCODE_RELAX (rc.lpos, STATE_BITS10), /* Wild guess.  */
 				   exp.X_add_symbol,
 				   0,	/* Offset is zero if jump dist less than 1K.  */
@@ -1727,7 +1727,7 @@ msp430_operands (struct msp430_opcode_s 
 	      frag = frag_more (8);
 	      bfd_putl16 ((bfd_vma) hc.op0, frag);
 	      bfd_putl16 ((bfd_vma) hc.op1, frag+2);
-	      frag = frag_variant (rs_machine_dependent, 8, 2,
+	      frag = frag_variant (rs_machine_dependent, 8, 2L,
 				   ENCODE_RELAX (STATE_EMUL_BRANCH, STATE_BITS10), /* Wild guess.  */
 				   exp.X_add_symbol,
 				   0,	/* Offset is zero if jump dist less than 1K.  */
--- gas/config/tc-xtensa.c.64bit	2005-04-09 13:58:23.000000000 -0700
+++ gas/config/tc-xtensa.c	2005-04-10 09:19:57.993956558 -0700
@@ -2247,7 +2247,7 @@ xg_translate_sysreg_op (char **popname, 
       if (sr == XTENSA_UNDEFINED)
 	{
 	  as_bad (_("invalid register number (%ld) for '%s' instruction"),
-		  val, opname);
+		  (long) val, opname);
 	  return -1;
 	}
     }
@@ -2316,7 +2316,7 @@ xtensa_translate_old_userreg_ops (char *
       if (sr == XTENSA_UNDEFINED)
 	{
 	  as_bad (_("invalid register number (%ld) for '%s'"),
-		  val, opname);
+		  (long) val, opname);
 	  return -1;
 	}
     }
@@ -4650,10 +4650,10 @@ xtensa_mark_literal_pool_location (void)
      frchain's fix list.  We can use fr_var because fr_var's
      interpretation depends solely on the fr_type and subtype.  */
   pool_location = frag_now;
-  frag_variant (rs_machine_dependent, 0, (int) frchain_now,
+  frag_variant (rs_machine_dependent, 0, (long) frchain_now,
 		RELAX_LITERAL_POOL_BEGIN, NULL, 0, NULL);
   xtensa_set_frag_assembly_state (frag_now);
-  frag_variant (rs_machine_dependent, 0, (int) now_seg,
+  frag_variant (rs_machine_dependent, 0, (long) now_seg,
 		RELAX_LITERAL_POOL_END, NULL, 0, NULL);
   xtensa_set_frag_assembly_state (frag_now);
 
@@ -4882,7 +4882,7 @@ xtensa_find_unaligned_branch_targets (bf
 	      if (frag_addr + op_size > branch_align)
 		as_warn_where (frag->fr_file, frag->fr_line,
 			       _("unaligned branch target: %d bytes at 0x%lx"),
-			       op_size, frag->fr_address);
+			       op_size, (long) frag->fr_address);
 	    }
 	  frag = frag->fr_next;
 	}
@@ -4921,7 +4921,7 @@ xtensa_find_unaligned_loops (bfd *abfd A
 	      if (frag_addr + op_size > xtensa_fetch_width)
 		as_warn_where (frag->fr_file, frag->fr_line,
 			       _("unaligned loop: %d bytes at 0x%lx"),
-			       op_size, frag->fr_address);
+			       op_size, (long) frag->fr_address);
 	    }
 	  frag = frag->fr_next;
 	}
@@ -6890,7 +6890,7 @@ xg_assemble_vliw_tokens (vliw_insn *vins
   if (finish_frag)
     {
       frag_variant (rs_machine_dependent,
-		    extra_space, extra_space, RELAX_SLOTS,
+		    extra_space, (long) extra_space, RELAX_SLOTS,
 		    frag_now->fr_symbol, frag_now->fr_offset, f);
       xtensa_set_frag_assembly_state (frag_now);
     }
@@ -7462,7 +7462,7 @@ xtensa_fix_close_loop_end_frags (void)
 			  
 			  if (fragP->fr_var < length)
 			    as_fatal (_("fr_var %lu < length %d"),
-				      fragP->fr_var, length);
+				      (long) fragP->fr_var, length);
 			  else
 			    {
 			      assemble_nop (length,
@@ -8410,7 +8410,8 @@ relax_frag_add_nop (fragS *fragP)
 
   if (fragP->fr_var < length)
     {
-      as_fatal (_("fr_var (%ld) < length (%d)"), fragP->fr_var, length);
+      as_fatal (_("fr_var (%ld) < length (%d)"),
+		(long) fragP->fr_var, length);
       return 0;
     }
 
@@ -9872,14 +9873,14 @@ xtensa_move_literals (void)
 	      /* Note that we set this fr_var to be a fix
 		 chain when we created the literal pool location
 		 as RELAX_LITERAL_POOL_BEGIN.  */
-	      frchain_to = (frchainS *) literal_pool->fr_var;
+	      frchain_to = (frchainS *) (unsigned long) literal_pool->fr_var;
 	    }
 	  insert_after = literal_pool;
 
 	  while (insert_after->fr_next->fr_subtype != RELAX_LITERAL_POOL_END)
 	    insert_after = insert_after->fr_next;
 
-	  dest_seg = (segT) insert_after->fr_next->fr_var;
+	  dest_seg = (segT) (unsigned long) insert_after->fr_next->fr_var;
 
 	  *frag_splice = next_frag;
 	  search_frag->fr_next = insert_after->fr_next;
--- gas/frags.c.64bit	2005-03-03 08:56:17.000000000 -0800
+++ gas/frags.c	2005-04-10 09:18:02.244964784 -0700
@@ -226,7 +226,7 @@ frag_var (relax_stateT type, int max_cha
 	No call to frag_grow is done.  */
 
 char *
-frag_variant (relax_stateT type, int max_chars, int var,
+frag_variant (relax_stateT type, int max_chars, long var,
 	      relax_substateT subtype, symbolS *symbol, offsetT offset,
 	      char *opcode)
 {
--- gas/frags.h.64bit	2005-03-03 08:56:17.000000000 -0800
+++ gas/frags.h	2005-04-10 09:18:31.282199763 -0700
@@ -136,7 +136,7 @@ int frag_room (void);
 
 char *frag_variant (relax_stateT type,
 		    int max_chars,
-		    int var,
+		    long var,
 		    relax_substateT subtype,
 		    symbolS * symbol,
 		    offsetT offset,

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: PATCH: Support 64bit BFD and 64bit host for xtensa
  2005-04-10 16:39 ` PATCH: Support 64bit BFD and 64bit host for xtensa H. J. Lu
@ 2005-04-10 20:15   ` Andreas Schwab
  2005-04-10 20:27     ` H. J. Lu
  2005-04-11 16:58   ` Bob Wilson
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2005-04-10 20:15 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils, bob.wilson

"H. J. Lu" <hjl@lucon.org> writes:

> --- gas/config/tc-i960.c.64bit	2005-03-25 10:18:49.000000000 -0800
> +++ gas/config/tc-i960.c	2005-04-10 09:21:12.216332749 -0700
> @@ -599,7 +599,7 @@ get_cdisp (char *dispP, /* Displacement 
>  	    {
>  	      outP = frag_more (8);	/* Allocate worst-case storage.  */
>  	      md_number_to_chars (outP, instr, 4);
> -	      frag_variant (rs_machine_dependent, 4, 4, 1,
> +	      frag_variant (rs_machine_dependent, 4, 4L, 1,

What is this good for?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: PATCH: Support 64bit BFD and 64bit host for xtensa
  2005-04-10 20:15   ` Andreas Schwab
@ 2005-04-10 20:27     ` H. J. Lu
  0 siblings, 0 replies; 7+ messages in thread
From: H. J. Lu @ 2005-04-10 20:27 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: binutils, bob.wilson

On Sun, Apr 10, 2005 at 10:14:59PM +0200, Andreas Schwab wrote:
> "H. J. Lu" <hjl@lucon.org> writes:
> 
> > --- gas/config/tc-i960.c.64bit	2005-03-25 10:18:49.000000000 -0800
> > +++ gas/config/tc-i960.c	2005-04-10 09:21:12.216332749 -0700
> > @@ -599,7 +599,7 @@ get_cdisp (char *dispP, /* Displacement 
> >  	    {
> >  	      outP = frag_more (8);	/* Allocate worst-case storage.  */
> >  	      md_number_to_chars (outP, instr, 4);
> > -	      frag_variant (rs_machine_dependent, 4, 4, 1,
> > +	      frag_variant (rs_machine_dependent, 4, 4L, 1,
> 
> What is this good for?
> 

Just to play it safe.


H.J.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: PATCH: Support 64bit BFD and 64bit host for xtensa
  2005-04-10 16:39 ` PATCH: Support 64bit BFD and 64bit host for xtensa H. J. Lu
  2005-04-10 20:15   ` Andreas Schwab
@ 2005-04-11 16:58   ` Bob Wilson
  2005-04-11 17:40     ` H. J. Lu
  1 sibling, 1 reply; 7+ messages in thread
From: Bob Wilson @ 2005-04-11 16:58 UTC (permalink / raw)
  To: binutils

H. J. Lu wrote:
> On Sat, Apr 09, 2005 at 01:48:35PM -0700, H. J. Lu wrote:
> 
>>m68k and xtensa are failed to build with --enable-64-bit-bfd. This
>>patch fixes it.

This part is OK with me.


> It turns out that xtensa doesn't support 64bit BFD on 32bit host
> nor 64bit host. xtensa passes pointer as int to frag_variant, where
> it is stored as offsetT. This patch changes int to long.

This doesn't seem like the right solution.  I'd rather not be casting pointers 
to integers, even if the integer is big enough.  Let me see if I can find a way 
to avoid storing pointers in the frag's fr_var field.

--Bob

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: PATCH: Support 64bit BFD and 64bit host for xtensa
  2005-04-11 16:58   ` Bob Wilson
@ 2005-04-11 17:40     ` H. J. Lu
  2005-04-14 22:38       ` Bob Wilson
  0 siblings, 1 reply; 7+ messages in thread
From: H. J. Lu @ 2005-04-11 17:40 UTC (permalink / raw)
  To: Bob Wilson; +Cc: binutils

On Mon, Apr 11, 2005 at 09:55:38AM -0700, Wilson; Bob, Tensillca wrote:
> H. J. Lu wrote:
> >On Sat, Apr 09, 2005 at 01:48:35PM -0700, H. J. Lu wrote:
> >
> >>m68k and xtensa are failed to build with --enable-64-bit-bfd. This
> >>patch fixes it.
> 
> This part is OK with me.
> 
> 
> >It turns out that xtensa doesn't support 64bit BFD on 32bit host
> >nor 64bit host. xtensa passes pointer as int to frag_variant, where
> >it is stored as offsetT. This patch changes int to long.
> 
> This doesn't seem like the right solution.  I'd rather not be casting 
> pointers to integers, even if the integer is big enough.  Let me see if I 
> can find a way to avoid storing pointers in the frag's fr_var field.
> 

I will leave xtensa to you. You can pick my xtensa patch if you want.


H.J.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: PATCH: Support 64bit BFD and 64bit host for xtensa
  2005-04-11 17:40     ` H. J. Lu
@ 2005-04-14 22:38       ` Bob Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Bob Wilson @ 2005-04-14 22:38 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 1177 bytes --]

H. J. Lu wrote:
> I will leave xtensa to you. You can pick my xtensa patch if you want.

OK.  Here's a patch that combines your casts for 64-bit builds with a simple 
solution to the pointers-stored-as-ints problem.  I would really love to replace 
all the code involved in the latter problem, but it will be a while before I can 
get to it, and I didn't want to leave the 64-bit builds broken in the meantime. 
  I just changed the code to use pointer fields in the Xtensa-specific 
tc_frag_data structure.

I tested this with --enable-64-bit-bfd builds on both x86_64-unknown-linux-gnu 
and i686-pc-linux-gnu hosts.  Committed on the mainline and 2.16 branch.


2005-04-14  Bob Wilson  <bob.wilson@acm.org>
	    H.J. Lu  <hongjiu.lu@intel.com>

	* config/tc-xtensa.h (struct xtensa_frag_type): Add lit_frchain field.
	* config/tc-xtensa.c (xg_translate_sysreg_op,
	xtensa_translate_old_userregs_ops,
	xtensa_find_unaligned_branch_targets,
	xtensa_find_unaligned_loops, xtensa_fix_close_loop_end_frags,
	relax_frag_add_nop): Support 64-bit host.
	(xtensa_mark_literal_pool_location, xtensa_move_literals): Use
	tc_frag_data lit_frchain and lit_seg fields instead of fr_var.



[-- Attachment #2: gas64.diff --]
[-- Type: text/x-patch, Size: 4709 bytes --]

Index: config/tc-xtensa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.c,v
retrieving revision 1.31
diff -u -p -r1.31 tc-xtensa.c
--- config/tc-xtensa.c	11 Apr 2005 22:45:37 -0000	1.31
+++ config/tc-xtensa.c	14 Apr 2005 22:01:57 -0000
@@ -2247,7 +2247,7 @@ xg_translate_sysreg_op (char **popname, 
       if (sr == XTENSA_UNDEFINED)
 	{
 	  as_bad (_("invalid register number (%ld) for '%s' instruction"),
-		  val, opname);
+		  (long) val, opname);
 	  return -1;
 	}
     }
@@ -2316,7 +2316,7 @@ xtensa_translate_old_userreg_ops (char *
       if (sr == XTENSA_UNDEFINED)
 	{
 	  as_bad (_("invalid register number (%ld) for '%s'"),
-		  val, opname);
+		  (long) val, opname);
 	  return -1;
 	}
     }
@@ -4645,15 +4645,15 @@ xtensa_mark_literal_pool_location (void)
   frag_align (2, 0, 0);
   record_alignment (now_seg, 2);
 
-  /* We stash info in the fr_var of these frags
-     so we can later move the literal's fixes into this
-     frchain's fix list.  We can use fr_var because fr_var's
-     interpretation depends solely on the fr_type and subtype.  */
+  /* We stash info in these frags so we can later move the literal's
+     fixes into this frchain's fix list.  */
   pool_location = frag_now;
-  frag_variant (rs_machine_dependent, 0, (int) frchain_now,
+  frag_now->tc_frag_data.lit_frchain = frchain_now;
+  frag_variant (rs_machine_dependent, 0, 0,
 		RELAX_LITERAL_POOL_BEGIN, NULL, 0, NULL);
   xtensa_set_frag_assembly_state (frag_now);
-  frag_variant (rs_machine_dependent, 0, (int) now_seg,
+  frag_now->tc_frag_data.lit_seg = now_seg;
+  frag_variant (rs_machine_dependent, 0, 0,
 		RELAX_LITERAL_POOL_END, NULL, 0, NULL);
   xtensa_set_frag_assembly_state (frag_now);
 
@@ -4882,7 +4882,7 @@ xtensa_find_unaligned_branch_targets (bf
 	      if (frag_addr + op_size > branch_align)
 		as_warn_where (frag->fr_file, frag->fr_line,
 			       _("unaligned branch target: %d bytes at 0x%lx"),
-			       op_size, frag->fr_address);
+			       op_size, (long) frag->fr_address);
 	    }
 	  frag = frag->fr_next;
 	}
@@ -4921,7 +4921,7 @@ xtensa_find_unaligned_loops (bfd *abfd A
 	      if (frag_addr + op_size > xtensa_fetch_width)
 		as_warn_where (frag->fr_file, frag->fr_line,
 			       _("unaligned loop: %d bytes at 0x%lx"),
-			       op_size, frag->fr_address);
+			       op_size, (long) frag->fr_address);
 	    }
 	  frag = frag->fr_next;
 	}
@@ -7462,7 +7462,7 @@ xtensa_fix_close_loop_end_frags (void)
 			  
 			  if (fragP->fr_var < length)
 			    as_fatal (_("fr_var %lu < length %d"),
-				      fragP->fr_var, length);
+				      (long) fragP->fr_var, length);
 			  else
 			    {
 			      assemble_nop (length,
@@ -8410,7 +8410,7 @@ relax_frag_add_nop (fragS *fragP)
 
   if (fragP->fr_var < length)
     {
-      as_fatal (_("fr_var (%ld) < length (%d)"), fragP->fr_var, length);
+      as_fatal (_("fr_var (%ld) < length (%d)"), (long) fragP->fr_var, length);
       return 0;
     }
 
@@ -9869,17 +9869,15 @@ xtensa_move_literals (void)
 	    {
 	      literal_pool = search_frag->tc_frag_data.literal_frag;
 	      assert (literal_pool->fr_subtype == RELAX_LITERAL_POOL_BEGIN);
-	      /* Note that we set this fr_var to be a fix
-		 chain when we created the literal pool location
-		 as RELAX_LITERAL_POOL_BEGIN.  */
-	      frchain_to = (frchainS *) literal_pool->fr_var;
+	      frchain_to = literal_pool->tc_frag_data.lit_frchain;
+	      assert (frchain_to);
 	    }
 	  insert_after = literal_pool;
 
 	  while (insert_after->fr_next->fr_subtype != RELAX_LITERAL_POOL_END)
 	    insert_after = insert_after->fr_next;
 
-	  dest_seg = (segT) insert_after->fr_next->fr_var;
+	  dest_seg = insert_after->fr_next->tc_frag_data.lit_seg;
 
 	  *frag_splice = next_frag;
 	  search_frag->fr_next = insert_after->fr_next;
Index: config/tc-xtensa.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.h,v
retrieving revision 1.10
diff -u -p -r1.10 tc-xtensa.h
--- config/tc-xtensa.h	26 Mar 2005 00:21:01 -0000	1.10
+++ config/tc-xtensa.h	14 Apr 2005 22:01:57 -0000
@@ -227,9 +227,13 @@ struct xtensa_frag_type
   fragS *literal_frag;
 
   /* The destination segment for literal frags.  (Note that this is only
-     valid after xtensa_move_literals.  */
+     valid after xtensa_move_literals.)  This field is also used for
+     LITERAL_POOL_END frags.  */
   segT lit_seg;
 
+  /* Frag chain for LITERAL_POOL_BEGIN frags.  */
+  struct frchain *lit_frchain;
+
   /* For the relaxation scheme, some literal fragments can have their
      expansions modified by an instruction that relaxes.  */
   int text_expansion[MAX_SLOTS];

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-04-14 22:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-09 20:48 PATCH: Support 64bit BFD for m68k and xtensa H. J. Lu
2005-04-10 16:39 ` PATCH: Support 64bit BFD and 64bit host for xtensa H. J. Lu
2005-04-10 20:15   ` Andreas Schwab
2005-04-10 20:27     ` H. J. Lu
2005-04-11 16:58   ` Bob Wilson
2005-04-11 17:40     ` H. J. Lu
2005-04-14 22:38       ` Bob Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).