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]

fx_plt


This patch removes the fx_plt field of struct fix.  The only backends
that really made use of it were ia64 and xtensa, and both are easily
weaned.  Howver, I left xtensa using one of the struct fix bitfields
since it seems like the port then wouldn't need TC_FIX_TYPE.

	* write.h (struct fix <fx_pcrel_adjust, fx_size>): Move.
	(struct fix <fx_plt>): Rename to tcbit2.
	* write.c (fix_new_internal): Adjust.
	(TC_FORCE_RELOCATION_LOCAL): Don't test fx_plt.
	* config/tc-arm.h (TC_FORCE_RELOCATION_LOCAL): Likewise.
	* config/tc-cris.h (TC_FORCE_RELOCATION_LOCAL): Likewise.
	* config/tc-i386.h (TC_FORCE_RELOCATION_LOCAL): Likewise.
	* config/tc-i960.h (TC_FORCE_RELOCATION_LOCAL): Likewise.
	* config/tc-sh.h (TC_FORCE_RELOCATION_LOCAL): Likewise.
	* config/tc-sh64.h (TC_FORCE_RELOCATION_LOCAL): Likewise.
	* config/tc-sparc.h (TC_FORCE_RELOCATION_LOCAL): Likewise.
	* config/tc-msp430.c (msp430_force_relocation_local): Likewise.
	* config/tc-ia64.c (emit_one_bundle): Don't set fx_plt.
	* config/tc-ia64.h (TC_FORCE_RELOCATION_LOCAL): Don't test fx_plt.
	Instead, compare fx_r_type.
	* config/tc-xtensa.c (xg_add_opcode_fix, md_apply_fix): Use
	fx_tcbit in place of fx_plt.
	* config/tc-xtensa.h (TC_FORCE_RELOCATION_LOCAL): Define.
	* doc/internals.texi (TC_FORCE_RELOCATION_LOCAL): Remove reference
	to fx_plt.

Index: gas/write.h
===================================================================
RCS file: /cvs/src/src/gas/write.h,v
retrieving revision 1.15
diff -u -p -r1.15 write.h
--- gas/write.h	7 May 2006 23:03:48 -0000	1.15
+++ gas/write.h	1 Feb 2007 07:58:33 -0000
@@ -45,29 +45,16 @@ struct fix
   /* These small fields are grouped together for compactness of
      this structure, and efficiency of access on some architectures.  */
 
-  /* pc-relative offset adjust (only used by m68k) */
-  char fx_pcrel_adjust;
-
-  /* How many bytes are involved? */
-  unsigned char fx_size;
-
   /* Is this a pc-relative relocation?  */
   unsigned fx_pcrel : 1;
 
-  /* Is this a relocation to a procedure linkage table entry?  If so,
-     some of the reductions we try to apply are invalid.  A better way
-     might be to represent PLT entries with different kinds of
-     symbols, and use normal relocations (with undefined symbols);
-     look into it for version 2.6.  */
-  unsigned fx_plt : 1;
-
   /* Is this value an immediate displacement?  */
-  /* Only used on i960 and ns32k; merge it into TC_FIX_TYPE sometime.  */
+  /* Only used on ns32k; merge it into TC_FIX_TYPE sometime.  */
   unsigned fx_im_disp : 2;
 
-  /* A bit for the CPU specific code.
-     This probably can be folded into tc_fix_data, below.  */
+  /* Some bits for the CPU specific code.  */
   unsigned fx_tcbit : 1;
+  unsigned fx_tcbit2 : 1;
 
   /* Has this relocation already been applied?  */
   unsigned fx_done : 1;
@@ -82,6 +69,12 @@ struct fix
   /* The value is signed when checking for overflow.  */
   unsigned fx_signed : 1;
 
+  /* pc-relative offset adjust (only used by m68k and m68hc11) */
+  char fx_pcrel_adjust;
+
+  /* How many bytes are involved? */
+  unsigned char fx_size;
+
   /* Which frag does this fix apply to?  */
   fragS *fx_frag;
 
Index: gas/write.c
===================================================================
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.103
diff -u -p -r1.103 write.c
--- gas/write.c	26 Oct 2006 00:17:49 -0000	1.103
+++ gas/write.c	1 Feb 2007 07:58:33 -0000
@@ -1,6 +1,6 @@
 /* write.c - emit .o file
    Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -45,7 +45,6 @@
 #ifndef TC_FORCE_RELOCATION_LOCAL
 #define TC_FORCE_RELOCATION_LOCAL(FIX)		\
   (!(FIX)->fx_pcrel				\
-   || (FIX)->fx_plt				\
    || TC_FORCE_RELOCATION (FIX))
 #endif
 
@@ -169,13 +168,13 @@ fix_new_internal (fragS *frag,		/* Which
   fixP->fx_offset = offset;
   fixP->fx_dot_value = dot_value;
   fixP->fx_pcrel = pcrel;
-  fixP->fx_plt = 0;
   fixP->fx_r_type = r_type;
   fixP->fx_im_disp = 0;
   fixP->fx_pcrel_adjust = 0;
   fixP->fx_bit_fixP = 0;
   fixP->fx_addnumber = 0;
   fixP->fx_tcbit = 0;
+  fixP->fx_tcbit2 = 0;
   fixP->fx_done = 0;
   fixP->fx_no_overflow = 0;
   fixP->fx_signed = 0;
Index: gas/config/tc-arm.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.h,v
retrieving revision 1.43
diff -u -p -r1.43 tc-arm.h
--- gas/config/tc-arm.h	29 Nov 2006 17:53:39 -0000	1.43
+++ gas/config/tc-arm.h	1 Feb 2007 07:58:33 -0000
@@ -1,6 +1,6 @@
 /* This file is tc-arm.h
    Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005, 2006 Free Software Foundation, Inc.
+   2004, 2005, 2006, 2007 Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
 	Modified by David Taylor (dtaylor@armltd.co.uk)
 
@@ -161,7 +161,6 @@ bfd_boolean arm_is_eabi (void);
 
 #define TC_FORCE_RELOCATION_LOCAL(FIX)			\
   (!(FIX)->fx_pcrel					\
-   || (FIX)->fx_plt					\
    || (FIX)->fx_r_type == BFD_RELOC_ARM_GOT32		\
    || (FIX)->fx_r_type == BFD_RELOC_32			\
    || TC_FORCE_RELOCATION (FIX))
Index: gas/config/tc-cris.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-cris.h,v
retrieving revision 1.15
diff -u -p -r1.15 tc-cris.h
--- gas/config/tc-cris.h	8 Jul 2005 03:54:30 -0000	1.15
+++ gas/config/tc-cris.h	1 Feb 2007 07:58:33 -0000
@@ -1,5 +1,5 @@
 /* tc-cris.h -- Header file for tc-cris.c, the CRIS GAS port.
-   Copyright 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2007
    Free Software Foundation, Inc.
 
    Contributed by Axis Communications AB, Lund, Sweden.
@@ -99,10 +99,9 @@ extern int md_cris_force_relocation (str
    || (RTYPE) == BFD_RELOC_CRIS_32_PLT_PCREL)
 
 /* Make sure we don't resolve fixups for which we want to emit dynamic
-   relocations.  FIXME: Set fx_plt instead of using IS_CRIS_PIC_RELOC.  */
+   relocations.  */
 #define TC_FORCE_RELOCATION_LOCAL(FIX)			\
   (!(FIX)->fx_pcrel					\
-   || (FIX)->fx_plt					\
    || IS_CRIS_PIC_RELOC ((FIX)->fx_r_type)		\
    || TC_FORCE_RELOCATION (FIX))
 
Index: gas/config/tc-i386.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.h,v
retrieving revision 1.80
diff -u -p -r1.80 tc-i386.h
--- gas/config/tc-i386.h	3 Jan 2007 22:54:45 -0000	1.80
+++ gas/config/tc-i386.h	1 Feb 2007 07:58:38 -0000
@@ -457,7 +457,6 @@ extern int tc_i386_fix_adjustable (struc
 
 #define TC_FORCE_RELOCATION_LOCAL(FIX)			\
   (!(FIX)->fx_pcrel					\
-   || (FIX)->fx_plt					\
    || (FIX)->fx_r_type == BFD_RELOC_386_PLT32		\
    || (FIX)->fx_r_type == BFD_RELOC_386_GOT32		\
    || (FIX)->fx_r_type == BFD_RELOC_386_GOTPC		\
Index: gas/config/tc-i960.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i960.h,v
retrieving revision 1.15
diff -u -p -r1.15 tc-i960.h
--- gas/config/tc-i960.h	11 Aug 2005 01:25:27 -0000	1.15
+++ gas/config/tc-i960.h	1 Feb 2007 07:58:38 -0000
@@ -1,6 +1,6 @@
 /* tc-i960.h - Basic 80960 instruction formats.
    Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2007
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -139,7 +139,6 @@ extern int reloc_callj PARAMS ((struct f
 
 #define TC_FORCE_RELOCATION_LOCAL(FIX)		\
   (!(FIX)->fx_pcrel				\
-   || (FIX)->fx_plt				\
    || TC_FORCE_RELOCATION (FIX)		\
    || reloc_callj (FIX))
 
Index: gas/config/tc-ia64.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.c,v
retrieving revision 1.189
diff -u -p -r1.189 tc-ia64.c
--- gas/config/tc-ia64.c	2 May 2006 13:34:25 -0000	1.189
+++ gas/config/tc-ia64.c	1 Feb 2007 07:58:43 -0000
@@ -1,5 +1,5 @@
 /* tc-ia64.c -- Assembler for the HP/Intel IA-64 architecture.
-   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
    Free Software Foundation, Inc.
    Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
 
@@ -7067,7 +7067,6 @@ emit_one_bundle ()
 	  fix = fix_new_exp (frag_now, frag_now_fix () - 16 + i, 8,
 			     &ifix->expr, ifix->is_pcrel, ifix->code);
 	  fix->tc_fix_data.opnd = ifix->opnd;
-	  fix->fx_plt = (fix->fx_r_type == BFD_RELOC_IA64_PLTOFF22);
 	  fix->fx_file = md.slot[curr].src_file;
 	  fix->fx_line = md.slot[curr].src_line;
 	}
Index: gas/config/tc-ia64.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.h,v
retrieving revision 1.41
diff -u -p -r1.41 tc-ia64.h
--- gas/config/tc-ia64.h	11 Oct 2005 11:16:16 -0000	1.41
+++ gas/config/tc-ia64.h	1 Feb 2007 07:58:44 -0000
@@ -1,5 +1,5 @@
 /* tc-ia64.h -- Header file for tc-ia64.c.
-   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
    Free Software Foundation, Inc.
    Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
 
@@ -315,5 +315,5 @@ typedef struct unwind_record
 #define TC_FORCE_RELOCATION_LOCAL(FIX)			\
   ((FIX)->fx_r_type != BFD_RELOC_UNUSED			\
    && (!(FIX)->fx_pcrel					\
-       || (FIX)->fx_plt					\
+       || (FIX)->fx_r_type == BFD_RELOC_IA64_PLTOFF22	\
        || TC_FORCE_RELOCATION (FIX)))
Index: gas/config/tc-msp430.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-msp430.c,v
retrieving revision 1.25
diff -u -p -r1.25 tc-msp430.c
--- gas/config/tc-msp430.c	7 Jun 2006 11:27:58 -0000	1.25
+++ gas/config/tc-msp430.c	1 Feb 2007 07:58:47 -0000
@@ -1,6 +1,7 @@
 /* tc-msp430.c -- Assembler code for the Texas Instruments MSP430
 
-  Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+  Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+  Free Software Foundation, Inc.
   Contributed by Dmitry Diky <diwil@mail.ru>
 
   This file is part of GAS, the GNU Assembler.
@@ -1915,7 +1916,6 @@ msp430_force_relocation_local(fixS *fixp
     return 1;
   else
     return (!fixp->fx_pcrel
-	    || fixp->fx_plt
 	    || generic_force_reloc(fixp));
 }
 
Index: gas/config/tc-sh.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-sh.h,v
retrieving revision 1.44
diff -u -p -r1.44 tc-sh.h
--- gas/config/tc-sh.h	13 Sep 2006 00:46:09 -0000	1.44
+++ gas/config/tc-sh.h	1 Feb 2007 07:58:47 -0000
@@ -1,6 +1,6 @@
 /* This file is tc-sh.h
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -189,7 +189,6 @@ extern bfd_boolean sh_fix_adjustable (st
 
 #define TC_FORCE_RELOCATION_LOCAL(FIX)			\
   (!(FIX)->fx_pcrel					\
-   || (FIX)->fx_plt					\
    || (FIX)->fx_r_type == BFD_RELOC_32_PLT_PCREL	\
    || (FIX)->fx_r_type == BFD_RELOC_32_GOT_PCREL	\
    || (FIX)->fx_r_type == BFD_RELOC_SH_GOTPC		\
Index: gas/config/tc-sh64.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-sh64.h,v
retrieving revision 1.13
diff -u -p -r1.13 tc-sh64.h
--- gas/config/tc-sh64.h	11 Oct 2005 11:16:16 -0000	1.13
+++ gas/config/tc-sh64.h	1 Feb 2007 07:58:47 -0000
@@ -1,5 +1,6 @@
 /* This file is tc-sh64.h
-   Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2000, 2001, 2002, 2003, 2007
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -79,7 +80,6 @@ extern int sh64_target_mach (void);
 #undef TC_FORCE_RELOCATION_LOCAL
 #define TC_FORCE_RELOCATION_LOCAL(FIX)			\
   (!(FIX)->fx_pcrel					\
-   || (FIX)->fx_plt					\
    || (FIX)->fx_r_type == BFD_RELOC_32_PLT_PCREL	\
    || (FIX)->fx_r_type == BFD_RELOC_SH_PLT_LOW16	\
    || (FIX)->fx_r_type == BFD_RELOC_SH_PLT_MEDLOW16	\
Index: gas/config/tc-sparc.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-sparc.h,v
retrieving revision 1.26
diff -u -p -r1.26 tc-sparc.h
--- gas/config/tc-sparc.h	18 Oct 2006 23:58:52 -0000	1.26
+++ gas/config/tc-sparc.h	1 Feb 2007 07:58:47 -0000
@@ -1,6 +1,7 @@
 /* tc-sparc.h - Macros and type defines for the sparc.
    Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003, 2005, 2007
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -91,7 +92,6 @@ extern void sparc_handle_align PARAMS ((
 
 #define TC_FORCE_RELOCATION_LOCAL(FIX)		\
   (!(FIX)->fx_pcrel				\
-   || (FIX)->fx_plt				\
    || (sparc_pic_code				\
        && S_IS_EXTERNAL ((FIX)->fx_addsy))	\
    || TC_FORCE_RELOCATION (FIX))
Index: gas/config/tc-xtensa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.c,v
retrieving revision 1.72
diff -u -p -r1.72 tc-xtensa.c
--- gas/config/tc-xtensa.c	27 Nov 2006 23:58:39 -0000	1.72
+++ gas/config/tc-xtensa.c	1 Feb 2007 07:58:51 -0000
@@ -4118,7 +4118,7 @@ xg_add_opcode_fix (TInsn *tinsn,
   if (expr->X_add_symbol
       && (S_IS_EXTERNAL (expr->X_add_symbol)
 	  || S_IS_WEAK (expr->X_add_symbol)))
-    the_fix->fx_plt = TRUE;
+    the_fix->fx_tcbit = TRUE;
 
   the_fix->tc_fix_data.X_add_symbol = expr->X_add_symbol;
   the_fix->tc_fix_data.X_add_number = expr->X_add_number;
@@ -5566,7 +5566,8 @@ md_apply_fix (fixS *fixP, valueT *valP, 
 	     readable when all branch targets are encoded in relocations.  */
 
 	  assert (fixP->fx_addsy);
-	  if (S_GET_SEGMENT (fixP->fx_addsy) == seg && !fixP->fx_plt
+	  if (S_GET_SEGMENT (fixP->fx_addsy) == seg
+	      && !fixP->fx_tcbit
 	      && !S_FORCE_RELOC (fixP->fx_addsy, 1))
 	    {
 	      val = (S_GET_VALUE (fixP->fx_addsy) + fixP->fx_offset
Index: gas/config/tc-xtensa.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.h,v
retrieving revision 1.20
diff -u -p -r1.20 tc-xtensa.h
--- gas/config/tc-xtensa.h	8 Aug 2006 19:09:33 -0000	1.20
+++ gas/config/tc-xtensa.h	1 Feb 2007 07:58:51 -0000
@@ -319,6 +319,10 @@ extern char *xtensa_section_rename (char
 #define TC_FORCE_RELOCATION(fix)	xtensa_force_relocation (fix)
 #define TC_FORCE_RELOCATION_SUB_SAME(fix, seg) \
   (! SEG_NORMAL (seg) || xtensa_force_relocation (fix))
+#define TC_FORCE_RELOCATION_LOCAL(FIX)		\
+  (!(FIX)->fx_pcrel				\
+   || (FIX)->fx_tcbit				\
+   || TC_FORCE_RELOCATION (FIX))
 #define	TC_VALIDATE_FIX_SUB(fix)	xtensa_validate_fix_sub (fix)
 #define NO_PSEUDO_DOT			xtensa_check_inside_bundle ()
 #define tc_canonicalize_symbol_name(s)	xtensa_section_rename (s)
Index: gas/doc/internals.texi
===================================================================
RCS file: /cvs/src/src/gas/doc/internals.texi,v
retrieving revision 1.52
diff -u -p -r1.52 internals.texi
--- gas/doc/internals.texi	22 Sep 2006 11:35:14 -0000	1.52
+++ gas/doc/internals.texi	1 Feb 2007 07:58:53 -0000
@@ -1279,7 +1279,7 @@ absolute symbol.  If undefined, @code{TC
 @cindex TC_FORCE_RELOCATION_LOCAL
 Like @code{TC_FORCE_RELOCATION}, but used only for fixup expressions against a
 symbol in the current section.  If undefined, fixups that are not
-@code{fx_pcrel} or @code{fx_plt} or for which @code{TC_FORCE_RELOCATION}
+@code{fx_pcrel} or for which @code{TC_FORCE_RELOCATION}
 returns non-zero, will emit relocs.
 
 @item TC_FORCE_RELOCATION_SUB_SAME (@var{fix}, @var{seg})

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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