* symbols.c (S_FORCE_RELOC): Add "strict" param.
authorAlan Modra <amodra@gmail.com>
Thu, 23 Jan 2003 12:51:05 +0000 (12:51 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 23 Jan 2003 12:51:05 +0000 (12:51 +0000)
* symbols.h (S_FORCE_RELOC): Likewise.
* config/obj-aout.h (S_FORCE_RELOC): Likewise.
* config/obj-bout.h (S_FORCE_RELOC): Likewise.
* config/obj-coff.h (S_FORCE_RELOC): Likewise.
* config/obj-ieee.h (S_FORCE_RELOC): Likewise.
* config/obj-vms.h (S_FORCE_RELOC): Likewise.
* write.c (generic_force_reloc): New function.
(TC_FORCE_RELOCATION): Use it here instead of S_FORCE_RELOC.
(TC_FORCE_RELOCATION_SUB_SAME): Test TC_FORCE_RELOCATION too.
(adjust_reloc_syms): Adjust S_FORCE_RELOC call.
* as.h (generic_force_reloc): Declare.
* doc/internals.texi (S_FORCE_RELOC): Update.
(TC_FORCE_RELOCATION_SUB_SAME): Update.

* config/tc-alpha.c (alpha_force_relocation): Adjust to use
generic_force_reloc.
(alpha_fix_adjustable): Likewise.
* config/tc-arm.c (arm_force_relocation): Likewise.
* config/tc-cris.c (md_cris_force_relocation): Likewise.
* config/tc-frv.c (frv_force_relocation): Likewise.
* config/tc-i386.c (md_apply_fix3): Likewise.
* config/tc-ia64.c (ia64_force_relocation): Likewise.
* config/tc-ip2k.c (ip2k_force_relocation): Likewise.
* config/tc-m32r.c (m32r_force_relocation): Likewise.
* config/tc-m68hc11.c (tc_m68hc11_force_relocation): Likewise.
* config/tc-mcore.c (mcore_force_relocation): Likewise.
* config/tc-mips.c (mips_force_relocation): Likewise.
* config/tc-mmix.c (mmix_force_relocation): Likewise.
* config/tc-ppc.c (ppc_force_relocation): Likewise.
* config/tc-s390.c (tc_s390_force_relocation): Likewise.
* config/tc-sh.c (sh_force_relocation): Likewise.
(md_pcrel_from_section): Likewise.
* config/tc-sparc.c (tc_gen_reloc): Likewise.
* config/tc-v850.c (v850_force_relocation): Likewise.
* config/tc-xstormy16.c (xstormy16_force_relocation): Likewise.
* config/tc-i386.h (TC_FORCE_RELOCATION): Likewise.
* config/tc-mcore.h (TC_FORCE_RELOCATION): Likewise.
* config/tc-sparc.h (tc_fix_adjustable): Likewise.

* config/tc-d10v.c (d10v_force_relocation): Delete.
* config/tc-d10v.h (TC_FORCE_RELOCATION): Don't define.
* config/tc-dlx.c (md_dlx_force_relocation): Delete.
* config/tc-dlx.h (TC_FORCE_RELOCATION): Don't define.
* config/tc-fr30.c (fr30_force_relocation): Delete.
* config/tc-fr30.h (TC_FORCE_RELOCATION): Don't define.
* config/tc-mn10300.c (mn10300_force_relocation): Delete.
* config/tc-mn10300.h (TC_FORCE_RELOCATION): Don't define.
(TC_FORCE_RELOCATION_SUB_SAME): Test TC_FORCE_RELOCATION too.
* config/tc-i960.h (TC_FORCE_RELOCATION_SUB_SAME): Likewise.
* config/tc-hppa.c (hppa_force_relocation): Adjust S_FORCE_RELOC call.
* config/tc-mips.c (RELAX_BRANCH_TOOFAR): Warning fix.
* config/tc-mips.h (TC_FORCE_RELOCATION_SUB_SAME): Don't define.
* config/tc-openrisc.c (openrisc_force_relocation): Delete.
* config/tc-openrisc.h (TC_FORCE_RELOCATION): Don't define.
* config/tc-sparc.c (elf32_sparc_force_relocation): Delete.
* config/tc-sparc.h (TC_FORCE_RELOCATION): Don't define for ELF.
* config/tc-i386.c (i386_force_relocation): Delete.
* config/tc-i386.h (TC_FORCE_RELOCATION): Don't define for
BFD_ASSEMBLER.
(EXTERN_FORCE_RELOC): Fix TE_PE and STRICT_PE_FORMAT nesting.
* config/tc-m68k.h (TC_FORCE_RELOCATION): Don't define.
* config/tc-pj.h (TC_FORCE_RELOCATION): Don't define.
* config/tc-sh.h (TC_FORCE_RELOCATION_SUB_ABS): Don't call
S_FORCE_RELOC.
(TC_FORCE_RELOCATION_SUB_SAME): Test TC_FORCE_RELOCATION too.
* config/tc-sh64.h (TC_FORCE_RELOCATION_SUB_SAME): Likewise.

49 files changed:
gas/ChangeLog
gas/as.h
gas/config/obj-aout.h
gas/config/obj-bout.h
gas/config/obj-coff.h
gas/config/obj-ieee.h
gas/config/obj-vms.h
gas/config/tc-alpha.c
gas/config/tc-arm.c
gas/config/tc-cris.c
gas/config/tc-d10v.c
gas/config/tc-d10v.h
gas/config/tc-dlx.c
gas/config/tc-dlx.h
gas/config/tc-fr30.c
gas/config/tc-fr30.h
gas/config/tc-frv.c
gas/config/tc-hppa.c
gas/config/tc-i386.c
gas/config/tc-i386.h
gas/config/tc-i960.h
gas/config/tc-ia64.c
gas/config/tc-ip2k.c
gas/config/tc-m32r.c
gas/config/tc-m68hc11.c
gas/config/tc-m68k.h
gas/config/tc-mcore.c
gas/config/tc-mcore.h
gas/config/tc-mips.c
gas/config/tc-mips.h
gas/config/tc-mmix.c
gas/config/tc-mn10300.c
gas/config/tc-mn10300.h
gas/config/tc-openrisc.c
gas/config/tc-openrisc.h
gas/config/tc-pj.h
gas/config/tc-ppc.c
gas/config/tc-s390.c
gas/config/tc-sh.c
gas/config/tc-sh.h
gas/config/tc-sh64.h
gas/config/tc-sparc.c
gas/config/tc-sparc.h
gas/config/tc-v850.c
gas/config/tc-xstormy16.c
gas/doc/internals.texi
gas/symbols.c
gas/symbols.h
gas/write.c

index 42973b8640f60711aad241810773da9e6fa3bb66..049282a5bffdac333c4be8d242bdc3ddedad44e3 100644 (file)
@@ -1,3 +1,73 @@
+2003-01-23  Alan Modra  <amodra@bigpond.net.au>
+
+       * symbols.c (S_FORCE_RELOC): Add "strict" param.
+       * symbols.h (S_FORCE_RELOC): Likewise.
+       * config/obj-aout.h (S_FORCE_RELOC): Likewise.
+       * config/obj-bout.h (S_FORCE_RELOC): Likewise.
+       * config/obj-coff.h (S_FORCE_RELOC): Likewise.
+       * config/obj-ieee.h (S_FORCE_RELOC): Likewise.
+       * config/obj-vms.h (S_FORCE_RELOC): Likewise.
+       * write.c (generic_force_reloc): New function.
+       (TC_FORCE_RELOCATION): Use it here instead of S_FORCE_RELOC.
+       (TC_FORCE_RELOCATION_SUB_SAME): Test TC_FORCE_RELOCATION too.
+       (adjust_reloc_syms): Adjust S_FORCE_RELOC call.
+       * as.h (generic_force_reloc): Declare.
+       * doc/internals.texi (S_FORCE_RELOC): Update.
+       (TC_FORCE_RELOCATION_SUB_SAME): Update.
+
+       * config/tc-alpha.c (alpha_force_relocation): Adjust to use
+       generic_force_reloc.
+       (alpha_fix_adjustable): Likewise.
+       * config/tc-arm.c (arm_force_relocation): Likewise.
+       * config/tc-cris.c (md_cris_force_relocation): Likewise.
+       * config/tc-frv.c (frv_force_relocation): Likewise.
+       * config/tc-i386.c (md_apply_fix3): Likewise.
+       * config/tc-ia64.c (ia64_force_relocation): Likewise.
+       * config/tc-ip2k.c (ip2k_force_relocation): Likewise.
+       * config/tc-m32r.c (m32r_force_relocation): Likewise.
+       * config/tc-m68hc11.c (tc_m68hc11_force_relocation): Likewise.
+       * config/tc-mcore.c (mcore_force_relocation): Likewise.
+       * config/tc-mips.c (mips_force_relocation): Likewise.
+       * config/tc-mmix.c (mmix_force_relocation): Likewise.
+       * config/tc-ppc.c (ppc_force_relocation): Likewise.
+       * config/tc-s390.c (tc_s390_force_relocation): Likewise.
+       * config/tc-sh.c (sh_force_relocation): Likewise.
+       (md_pcrel_from_section): Likewise.
+       * config/tc-sparc.c (tc_gen_reloc): Likewise.
+       * config/tc-v850.c (v850_force_relocation): Likewise.
+       * config/tc-xstormy16.c (xstormy16_force_relocation): Likewise.
+       * config/tc-i386.h (TC_FORCE_RELOCATION): Likewise.
+       * config/tc-mcore.h (TC_FORCE_RELOCATION): Likewise.
+       * config/tc-sparc.h (tc_fix_adjustable): Likewise.
+
+       * config/tc-d10v.c (d10v_force_relocation): Delete.
+       * config/tc-d10v.h (TC_FORCE_RELOCATION): Don't define.
+       * config/tc-dlx.c (md_dlx_force_relocation): Delete.
+       * config/tc-dlx.h (TC_FORCE_RELOCATION): Don't define.
+       * config/tc-fr30.c (fr30_force_relocation): Delete.
+       * config/tc-fr30.h (TC_FORCE_RELOCATION): Don't define.
+       * config/tc-mn10300.c (mn10300_force_relocation): Delete.
+       * config/tc-mn10300.h (TC_FORCE_RELOCATION): Don't define.
+       (TC_FORCE_RELOCATION_SUB_SAME): Test TC_FORCE_RELOCATION too.
+       * config/tc-i960.h (TC_FORCE_RELOCATION_SUB_SAME): Likewise.
+       * config/tc-hppa.c (hppa_force_relocation): Adjust S_FORCE_RELOC call.
+       * config/tc-mips.c (RELAX_BRANCH_TOOFAR): Warning fix.
+       * config/tc-mips.h (TC_FORCE_RELOCATION_SUB_SAME): Don't define.
+       * config/tc-openrisc.c (openrisc_force_relocation): Delete.
+       * config/tc-openrisc.h (TC_FORCE_RELOCATION): Don't define.
+       * config/tc-sparc.c (elf32_sparc_force_relocation): Delete.
+       * config/tc-sparc.h (TC_FORCE_RELOCATION): Don't define for ELF.
+       * config/tc-i386.c (i386_force_relocation): Delete.
+       * config/tc-i386.h (TC_FORCE_RELOCATION): Don't define for
+       BFD_ASSEMBLER.
+       (EXTERN_FORCE_RELOC): Fix TE_PE and STRICT_PE_FORMAT nesting.
+       * config/tc-m68k.h (TC_FORCE_RELOCATION): Don't define.
+       * config/tc-pj.h (TC_FORCE_RELOCATION): Don't define.
+       * config/tc-sh.h (TC_FORCE_RELOCATION_SUB_ABS): Don't call
+       S_FORCE_RELOC.
+       (TC_FORCE_RELOCATION_SUB_SAME): Test TC_FORCE_RELOCATION too.
+       * config/tc-sh64.h (TC_FORCE_RELOCATION_SUB_SAME): Likewise.
+
 2003-01-23  Alan Modra  <amodra@bigpond.net.au>
 
        * config/tc-sh64.c (shmedia_frob_section_type): Adjust for changed
index 73b6b2bcc87fc87039cabe6f697a046d3e78d87b..eff09ce35b054742352e420f6a143017fd8a7716 100644 (file)
--- a/gas/as.h
+++ b/gas/as.h
@@ -608,6 +608,8 @@ int eh_frame_estimate_size_before_relax PARAMS ((fragS *));
 int eh_frame_relax_frag PARAMS ((fragS *));
 void eh_frame_convert_frag PARAMS ((fragS *));
 
+int generic_force_reloc PARAMS ((struct fix *));
+
 #include "expr.h"              /* Before targ-*.h */
 
 /* this one starts the chain of target dependant headers */
index 505c1a5acb3e0337c1f487dcb3ca164280d042c2..7fca45d19f07ec217ea9b10829381f892c1f9681 100644 (file)
@@ -1,6 +1,6 @@
 /* obj-aout.h, a.out object file format for gas, the assembler.
    Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000,
-   2002 Free Software Foundation, Inc.
+   2002, 2003 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -112,7 +112,7 @@ extern void obj_aout_frob_file_before_fix PARAMS ((void));
 /* Return true for symbols that should not be reduced to section
    symbols or eliminated from expressions, because they may be
    overridden by the linker.  */
-#define S_FORCE_RELOC(s) \
+#define S_FORCE_RELOC(s, strict) \
   (!SEG_NORMAL (S_GET_SEGMENT (s)))
 
 #define S_IS_REGISTER(s)       ((s)->sy_symbol.n_type == N_REGISTER)
index 3293902b98a426a04afb9dd2aa5c41de27b6e58d..374abbcc5586ec19d1cb21a1b31eda2d8996af77 100644 (file)
@@ -1,6 +1,6 @@
 /* b.out object file format
    Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000,
-   2002 Free Software Foundation, Inc.
+   2002, 2003 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -185,7 +185,7 @@ struct relocation_info
 /* Return true for symbols that should not be reduced to section
    symbols or eliminated from expressions, because they may be
    overridden by the linker.  */
-#define S_FORCE_RELOC(s) \
+#define S_FORCE_RELOC(s, strict) \
   (!SEG_NORMAL (S_GET_SEGMENT (s)))
 
 #define S_IS_COMMON(s) \
index e90dd70f0418fbd6a54034c210d3b263576b5356..6e852be4fd335db3843039c87f9498180efb14b0 100644 (file)
@@ -1,6 +1,6 @@
 /* coff object file format
    Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2002
+   1999, 2000, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of GAS.
@@ -500,8 +500,8 @@ typedef struct
 /* Return true for symbols that should not be reduced to section
    symbols or eliminated from expressions, because they may be
    overridden by the linker.  */
-#define S_FORCE_RELOC(s) \
-  (!SEG_NORMAL (S_GET_SEGMENT (s)) || S_IS_WEAK (s))
+#define S_FORCE_RELOC(s, strict) \
+  (!SEG_NORMAL (S_GET_SEGMENT (s)) || (strict && S_IS_WEAK (s)))
 
 /* True if a debug special symbol entry.  */
 #define S_IS_DEBUG(s) \
index 685ac4e57e565028a30fd5dfacdf254c9ca40f22..c0bd628a5443e74c13c52273a48c165a4d7abded 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is obj-ieee.h
-   Copyright 1987, 1988, 1989, 1990, 1991, 1992, 2000, 2002
+   Copyright 1987, 1988, 1989, 1990, 1991, 1992, 2000, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -35,7 +35,7 @@ obj_symbol_type;
 /* Return true for symbols that should not be reduced to section
    symbols or eliminated from expressions, because they may be
    overridden by the linker.  */
-#define S_FORCE_RELOC(s) (!SEG_NORMAL (x->sy_symbol.seg))
+#define S_FORCE_RELOC(s, strict) (!SEG_NORMAL (x->sy_symbol.seg))
 
 typedef struct
   {
index ac1fd3df4a87036623b06f730e2b2380df221bff..a535fc4547219108a6cfcc5e5431b7bdfbf937da 100644 (file)
@@ -1,6 +1,6 @@
 /* VMS object file format
    Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000,
-   2002 Free Software Foundation, Inc.
+   2002, 2003 Free Software Foundation, Inc.
 
 This file is part of GAS, the GNU Assembler.
 
@@ -142,7 +142,7 @@ typedef struct nlist obj_symbol_type;       /* Symbol table entry */
 /* Return true for symbols that should not be reduced to section
    symbols or eliminated from expressions, because they may be
    overridden by the linker.  */
-#define S_FORCE_RELOC(s) \
+#define S_FORCE_RELOC(s, strict) \
   (!SEG_NORMAL (S_GET_SEGMENT (s)))
 
 #define S_IS_REGISTER(s)       ((s)->sy_symbol.n_type == N_REGISTER)
index abbc96b194c0ef9f6c0ef0aa53717aa186cb28e7..5a65c43ff7eea214a51c442618fa216a36b014ae 100644 (file)
@@ -1,6 +1,6 @@
 /* tc-alpha.c - Processor-specific code for the DEC Alpha AXP CPU.
    Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002 Free Software Foundation, Inc.
+   2001, 2002, 2003 Free Software Foundation, Inc.
    Contributed by Carnegie Mellon University, 1993.
    Written by Alessandro Forin, based on earlier gas-1.38 target CPU files.
    Modified by Ken Raeburn for gas-2.x and ECOFF support.
@@ -1448,8 +1448,6 @@ alpha_force_relocation (f)
     case BFD_RELOC_ALPHA_LINKAGE:
     case BFD_RELOC_ALPHA_CODEADDR:
     case BFD_RELOC_ALPHA_BRSGP:
-    case BFD_RELOC_VTABLE_INHERIT:
-    case BFD_RELOC_VTABLE_ENTRY:
     case BFD_RELOC_ALPHA_TLSGD:
     case BFD_RELOC_ALPHA_TLSLDM:
     case BFD_RELOC_ALPHA_GOTDTPREL16:
@@ -1466,7 +1464,7 @@ alpha_force_relocation (f)
       break;
     }
 
-  return S_FORCE_RELOC (f->fx_addsy);
+  return generic_force_reloc (f);
 }
 
 /* Return true if we can partially resolve a relocation now.  */
@@ -1528,7 +1526,7 @@ alpha_fix_adjustable (f)
        const char *name;
        int offset = 0;
 
-       if (S_FORCE_RELOC (sym))
+       if (generic_force_reloc (f))
          return 0;
 
        switch (S_GET_OTHER (sym) & STO_ALPHA_STD_GPLOAD)
index e1e962b2624e612674b0b36aeb2a15cfc74cc000..e58848614c196e76d745b090c10a891468b74a36 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-arm.c -- Assemble for the ARM
-   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
        Modified by David Taylor (dtaylor@armltd.co.uk)
@@ -11443,9 +11443,7 @@ arm_force_relocation (fixp)
     return 1;
 #endif
 #ifdef OBJ_ELF
-  if (   fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY
-      || fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BRANCH
+  if (fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BRANCH
       || fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BLX
       || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX
       || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BRANCH23)
@@ -11457,7 +11455,7 @@ arm_force_relocation (fixp)
       || fixp->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE)
     return 0;
 
-  return S_FORCE_RELOC (fixp->fx_addsy);
+  return generic_force_reloc (fixp);
 }
 
 #ifdef OBJ_COFF
index 84f1a7589c009b98f7dab3ea6160ff1b56f7a43a..f5d724b3e3197568f16508b1a6940b7ebf1107e6 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-cris.c -- Assembler code for the CRIS CPU core.
-   Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
    Contributed by Axis Communications AB, Lund, Sweden.
    Originally written for GAS 1.38.1 by Mikael Asker.
@@ -3158,8 +3158,6 @@ md_cris_force_relocation (fixp)
 {
   switch (fixp->fx_r_type)
     {
-    case BFD_RELOC_VTABLE_INHERIT:
-    case BFD_RELOC_VTABLE_ENTRY:
     case BFD_RELOC_CRIS_16_GOT:
     case BFD_RELOC_CRIS_32_GOT:
     case BFD_RELOC_CRIS_16_GOTPLT:
@@ -3172,7 +3170,7 @@ md_cris_force_relocation (fixp)
       ;
     }
 
-  return S_FORCE_RELOC (fixp->fx_addsy);
+  return generic_force_reloc (fixp);
 }
 
 /* Check and emit error if broken-word handling has failed to fix up a
index 2689deddc0d883101b21354cac14125bd3ed8d1c..23bf1bbb9472c9552274f4363936fb406772cae5 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-d10v.c -- Assembler code for the Mitsubishi D10V
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -1903,14 +1903,3 @@ d10v_fix_adjustable (fixP)
 
   return 1;
 }
-
-int
-d10v_force_relocation (fixp)
-     fixS *fixp;
-{
-  if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
-    return 1;
-
-  return S_FORCE_RELOC (fixp->fx_addsy);
-}
index dd8ad58c5afa6a4df95ec3778792bed56566725d..502366222272c3c149383aeb7b038c47f58f1929 100644 (file)
@@ -60,9 +60,6 @@ int d10v_cleanup PARAMS ((void));
 #define tc_fix_adjustable(FIX) d10v_fix_adjustable(FIX)
 bfd_boolean d10v_fix_adjustable PARAMS ((struct fix *));
 
-#define TC_FORCE_RELOCATION(FIX) d10v_force_relocation(FIX)
-extern int d10v_force_relocation PARAMS ((struct fix *));
-
 /* Values passed to md_apply_fix3 don't include the symbol value.  */
 #define MD_APPLY_SYM_VALUE(FIX) 0
 
index 04ba94010eb5d6fabab8b635fbfe96f7f182e305..7d45ee1e8a3aeaa6a88f9dc01706eee7af5c6ef1 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-ldx.c -- Assemble for the DLX
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -1142,18 +1142,6 @@ md_chars_to_number (val, n)
   return retval;
 }
 
-/* Definition of TC_FORCE_RELOCATION.
-   we need this for gas to force relocation for VTABLE.  */
-
-int
-md_dlx_force_relocation (fixp)
-     struct fix *fixp;
-{
-  return (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-         || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY
-         || S_FORCE_RELOC (fixp->fx_addsy));
-}
-
 bfd_boolean
 md_dlx_fix_adjustable (fixP)
    fixS *fixP;
index aa3890be31a43e4f8da505c635caf3840ac831ae..8a78c775245dc10f8734ec8493002a29b686994a 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-dlx.h -- Assemble for the DLX
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -74,11 +74,6 @@ extern int dlx_unrecognized_line PARAMS ((int));
    visible symbols can be overridden.  */
 #define EXTERN_FORCE_RELOC 0
 
-/* We need to force out some relocations when relaxing.  */
-#define TC_FORCE_RELOCATION(FIX) md_dlx_force_relocation (FIX)
-struct fix;
-extern int md_dlx_force_relocation PARAMS ((struct fix *));
-
 #define tc_fix_adjustable(FIX) md_dlx_fix_adjustable (FIX)
 extern bfd_boolean md_dlx_fix_adjustable PARAMS ((struct fix *));
 
index 0a1c9e57534abf1c5d148e0f8abcc71056987d7e..f406107976b88ee5b6bd21506ab67160daa803c6 100644 (file)
@@ -1,5 +1,6 @@
 /* tc-fr30.c -- Assembler for the Fujitsu FR30.
-   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2000, 2001, 2002, 2003
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -469,21 +470,6 @@ md_cgen_lookup_reloc (insn, operand, fixP)
 
   return BFD_RELOC_NONE;
 }
-
-/* See whether we need to force a relocation into the output file.
-   This is used to force out switch and PC relative relocations when
-   relaxing.  */
-
-int
-fr30_force_relocation (fix)
-     fixS * fix;
-{
-  if (fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
-    return 1;
-
-  return S_FORCE_RELOC (fix->fx_addsy);
-}
 \f
 /* Write a value out to the object file, using the appropriate endianness.  */
 
index 5f7bc62cfec0e922f96d57481f073b3b48da47a8..ea283dc800b5b88b94bc67d29d81f8194aa026a0 100644 (file)
 struct fix;
 extern bfd_boolean fr30_fix_adjustable PARAMS ((struct fix *));
 
-/* When relaxing, we need to emit various relocs we otherwise wouldn't.  */
-#define TC_FORCE_RELOCATION(fix) fr30_force_relocation (fix)
-extern int fr30_force_relocation PARAMS ((struct fix *));
-
 #define tc_gen_reloc gas_cgen_tc_gen_reloc
 
 /* Call md_pcrel_from_section(), not md_pcrel_from().  */
index 79367f0f6c692bf9d6d9b8563245b67859f96669..f4b5bbd9bec0ea18ab2ebf994e35ad093a4a9916 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-frv.c -- Assembler for the Fujitsu FRV.
-   Copyright 2002 Free Software Foundation.
+   Copyright 2002, 2003 Free Software Foundation.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -1232,13 +1232,11 @@ int
 frv_force_relocation (fix)
      fixS * fix;
 {
-  if (fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY
-      || fix->fx_r_type == BFD_RELOC_FRV_GPREL12
+  if (fix->fx_r_type == BFD_RELOC_FRV_GPREL12
       || fix->fx_r_type == BFD_RELOC_FRV_GPRELU12)
     return 1;
 
-  return S_FORCE_RELOC (fix->fx_addsy);
+  return generic_force_reloc (fix);
 }
 \f
 /* Write a value out to the object file, using the appropriate endianness.  */
index e19ac93e4eac76595c86cf224ac3225048c96272..1cb9b7014c71768661d020df353c44bd54b3367c 100644 (file)
@@ -1,6 +1,6 @@
 /* tc-hppa.c -- Assemble for the PA
    Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002 Free Software Foundation, Inc.
+   2002, 2003 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -8518,7 +8518,7 @@ hppa_force_relocation (fixp)
 
   /* Ensure we emit a relocation for global symbols so that dynamic
      linking works.  */
-  if (S_FORCE_RELOC (fixp->fx_addsy))
+  if (S_FORCE_RELOC (fixp->fx_addsy, 1))
     return 1;
 
   /* It is necessary to force PC-relative calls/jumps to have a relocation
index fc1eeaf2a29a3a290e0afb4f6f138de519ea2d3f..5b01605fd248e1216daf039ca053ad99f6bf381d 100644 (file)
@@ -1,6 +1,6 @@
 /* i386.c -- Assemble code for the Intel 80386
    Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002
+   2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -4647,7 +4647,7 @@ md_apply_fix3 (fixP, valP, seg)
          if ((sym_seg == seg
               || (symbol_section_p (fixP->fx_addsy)
                   && sym_seg != absolute_section))
-             && !S_FORCE_RELOC (fixP->fx_addsy))
+             && !generic_force_reloc (fixP))
            {
              /* Yes, we add the values in twice.  This is because
                 bfd_install_relocation subtracts them out again.  I think
@@ -5146,17 +5146,6 @@ i386_validate_fix (fixp)
     }
 }
 
-bfd_boolean
-i386_force_relocation (fixp)
-     fixS *fixp;
-{
-  if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
-    return 1;
-
-  return S_FORCE_RELOC (fixp->fx_addsy);
-}
-
 arelent *
 tc_gen_reloc (section, fixp)
      asection *section ATTRIBUTE_UNUSED;
index 0a15fcd77ddbc305da5cdf3eeaa1e9449cf6fe56..45c3acf626d346713743a8b8565cbe78fae214ac 100644 (file)
@@ -1,6 +1,6 @@
 /* tc-i386.h -- Header file for tc-i386.c
    Copyright 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002
+   2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -471,20 +471,15 @@ extern int tc_i386_fix_adjustable PARAMS ((struct fix *));
 #define MD_APPLY_SYM_VALUE(FIX) 0
 
 /* ELF wants external syms kept, as does PE COFF.  */
-#ifdef TE_PE
-# ifdef STRICT_PE_FORMAT
-#   define EXTERN_FORCE_RELOC                          \
+#if defined (TE_PE) && defined (STRICT_PE_FORMAT)
+#define EXTERN_FORCE_RELOC                             \
   (OUTPUT_FLAVOR == bfd_target_elf_flavour             \
    || OUTPUT_FLAVOR == bfd_target_coff_flavour)
-# endif
 #else
 #define EXTERN_FORCE_RELOC                             \
   (OUTPUT_FLAVOR == bfd_target_elf_flavour)
 #endif
 
-#define TC_FORCE_RELOCATION(FIX)       i386_force_relocation (FIX)
-extern bfd_boolean i386_force_relocation PARAMS ((struct fix *));
-
 /* This expression evaluates to true if the relocation is for a local
    object for which we still want to do the relocation at runtime.
    False if we are willing to perform this relocation while building
@@ -513,7 +508,7 @@ extern bfd_boolean i386_force_relocation PARAMS ((struct fix *));
 
 /* For COFF.  */
 #define TC_FORCE_RELOCATION(FIX)                       \
-  ((FIX)->fx_r_type == 7 || S_FORCE_RELOC ((FIX)->fx_addsy))
+  ((FIX)->fx_r_type == 7 || generic_force_reloc (FIX))
 #endif /* ! BFD_ASSEMBLER */
 
 #define md_operand(x)
index f75fc3ba567ac216b60224854a22d7bfd112bc48..1df82f27e68249c77a55ce9c9dcf4859b2dc2cad 100644 (file)
@@ -134,7 +134,8 @@ struct relocation_info
    as the target of a call instruction.  */
 #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
   ((FIX)->fx_tcbit                             \
-   || ! SEG_NORMAL (SEG))
+   || ! SEG_NORMAL (SEG)                       \
+   || TC_FORCE_RELOCATION (FIX))
 
 /* reloc_callj() may replace a 'call' with a 'calls' or a
    'bal', in which cases it modifies *fixP as appropriate.
index a86da0e62bb5ed52f45ccc49cdcec9a793eee5d8..fa9ae005bd47f0f471c02bf6337f3f9d9be21106 100644 (file)
@@ -10015,7 +10015,7 @@ ia64_force_relocation (fix)
       break;
     }
 
-  return S_FORCE_RELOC (fix->fx_addsy);
+  return generic_force_reloc (fix);
 }
 
 /* Decide from what point a pc-relative relocation is relative to,
index 973b660934cd6f07f7b96dabcadc6d629c36a084..10f9895198c540fece8b76bd2c8b56ce03a4a53a 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-ip2k.c -- Assembler for the Scenix IP2xxx.
-   Copyright (C) 2000, 2002 Free Software Foundation.
+   Copyright (C) 2000, 2002, 2003 Free Software Foundation.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -385,10 +385,6 @@ ip2k_force_relocation (fix)
 {
   switch (fix->fx_r_type)
     {
-      /* (No C++ support in ip2k.  */
-      /* case BFD_RELOC_VTABLE_INHERIT: */
-      /* case BFD_RELOC_VTABLE_ENTRY: */
-
     case BFD_RELOC_IP2K_FR9:
     case BFD_RELOC_IP2K_FR_OFFSET:
     case BFD_RELOC_IP2K_BANK:
@@ -417,7 +413,7 @@ ip2k_force_relocation (fix)
       break;
     }
 
-  return S_FORCE_RELOC (fix->fx_addsy);
+  return generic_force_reloc (fix);
 }
 
 void
index adb084be5a2448d93fc4a51b12d536266c25d985..f6f5801fba7b0f478524343160706fa7ff447f02 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-m32r.c -- Assembler for the Mitsubishi M32R.
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -1818,9 +1818,7 @@ int
 m32r_force_relocation (fix)
      fixS *fix;
 {
-  if (fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY
-      || S_FORCE_RELOC (fix->fx_addsy))
+  if (generic_force_reloc (fix))
     return 1;
 
   if (! m32r_relax)
index da0f2ba90cdb52dd819c5df6879ab6c135dae8da..08e1a6e316dfbcb4e39a2877eebe0607fbe79e3f 100644 (file)
@@ -3187,18 +3187,10 @@ int
 tc_m68hc11_force_relocation (fixP)
      fixS * fixP;
 {
-  switch (fixP->fx_r_type)
-    {
-    case BFD_RELOC_VTABLE_INHERIT:
-    case BFD_RELOC_VTABLE_ENTRY:
-    case BFD_RELOC_M68HC11_RL_GROUP:
-      return 1;
-
-    default:
-      break;
-    }
+  if (fixP->fx_r_type == BFD_RELOC_M68HC11_RL_GROUP)
+    return 1;
 
-  return S_FORCE_RELOC (fixP->fx_addsy);
+  return generic_force_reloc (fixP);
 }
 
 /* Here we decide which fixups can be adjusted to make them relative
index 428d1f7631ccdd867cec1aecebf1467f7095fd60..477030049b9045151b7b968a671a6ba9ad4ae467 100644 (file)
@@ -1,6 +1,6 @@
 /* This file is tc-m68k.h
    Copyright 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001, 2002
+   1998, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -179,11 +179,6 @@ extern int tc_m68k_fix_adjustable PARAMS ((struct fix *));
 extern void m68k_elf_final_processing PARAMS ((void));
 #endif
 
-#define TC_FORCE_RELOCATION(FIX)                       \
-  ((FIX)->fx_r_type == BFD_RELOC_VTABLE_INHERIT        \
-   || (FIX)->fx_r_type == BFD_RELOC_VTABLE_ENTRY       \
-   || S_FORCE_RELOC ((FIX)->fx_addsy))
-
 #else /* ! BFD_ASSEMBLER */
 
 #define tc_frob_coff_symbol(sym) m68k_frob_symbol (sym)
index 9b59166b910fb4247d1d725cea0754350ded28a4..fe3317059b441cfbbc154178fc9778ba8c04ac88 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-mcore.c -- Assemble code for M*Core
-   Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -2371,12 +2371,10 @@ int
 mcore_force_relocation (fix)
      fixS * fix;
 {
-  if (   fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY
-      || fix->fx_r_type == BFD_RELOC_RVA)
+  if (fix->fx_r_type == BFD_RELOC_RVA)
     return 1;
 
-  return S_FORCE_RELOC (fix->fx_addsy);
+  return generic_force_reloc (fix);
 }
 
 /* Return true if the fix can be handled by GAS, false if it must
index c8e56f840fdef448e407a90aba34fcb65e6cec40..4ab84e45b75d48147aedfd963f3cf9cedd900644 100644 (file)
@@ -1,6 +1,7 @@
 /* This file is tc-mcore.h
 
-   Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002, 2003
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -73,7 +74,7 @@ struct mcore_tc_sy
 
 # if defined TE_PE
 #  define TC_FORCE_RELOCATION(x) \
-     ((x)->fx_r_type == BFD_RELOC_RVA || S_FORCE_RELOC ((x)->fx_addsy))
+     ((x)->fx_r_type == BFD_RELOC_RVA || generic_force_reloc (x))
 # endif
 
 #endif /* OBJ_COFF */
index b15d84f1e871bb05cb605fedfce1a2ad0b5580fd..2d5440ef85f292a70b991a092afdfc28ffd97bf5 100644 (file)
@@ -737,7 +737,7 @@ static int mips_relax_branch;
 #define RELAX_BRANCH_UNCOND(i) (((i) & 8) != 0)
 #define RELAX_BRANCH_LIKELY(i) (((i) & 4) != 0)
 #define RELAX_BRANCH_LINK(i) (((i) & 2) != 0)
-#define RELAX_BRANCH_TOOFAR(i) (((i) & 1))
+#define RELAX_BRANCH_TOOFAR(i) (((i) & 1) != 0)
 
 /* For mips16 code, we use an entirely different form of relaxation.
    mips16 supports two versions of most instructions which take
@@ -11173,9 +11173,7 @@ int
 mips_force_relocation (fixp)
      fixS *fixp;
 {
-  if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY
-      || S_FORCE_RELOC (fixp->fx_addsy))
+  if (generic_force_reloc (fixp))
     return 1;
 
   if (HAVE_NEWABI
index a19c87d474358f8055033dc295181100abb62c82..8d9c4ddf7f19bd0cda8a2abbcb00ce8b1c46d56c 100644 (file)
@@ -140,10 +140,6 @@ extern int mips_fix_adjustable PARAMS ((struct fix *));
 #define TC_FORCE_RELOCATION(FIX) mips_force_relocation (FIX)
 extern int mips_force_relocation PARAMS ((struct fix *));
 
-#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
-  (mips_force_relocation (FIX)                 \
-   || !SEG_NORMAL (SEG))
-
 /* Register mask variables.  These are set by the MIPS assembly code
    and used by ECOFF and possibly other object file formats.  */
 extern unsigned long mips_gprmask;
index 1a5f7ae44342f7d0b22d32b9b42c55e1dfbca580..c6ce34f8ebc46098774336dec772585859949087 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-mmix.c -- Assembler for Don Knuth's MMIX.
-   Copyright (C) 2001, 2002 Free Software Foundation.
+   Copyright (C) 2001, 2002, 2003 Free Software Foundation.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -3246,8 +3246,6 @@ mmix_force_relocation (fixP)
      fixS *fixP;
 {
   if (fixP->fx_r_type == BFD_RELOC_MMIX_LOCAL
-      || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY
       || fixP->fx_r_type == BFD_RELOC_MMIX_BASE_PLUS_OFFSET)
     return 1;
 
@@ -3261,7 +3259,7 @@ mmix_force_relocation (fixP)
   if (fixP->fx_pcrel)
     return 1;
 
-  return S_FORCE_RELOC (fixP->fx_addsy);
+  return generic_force_reloc (fixP);
 }
 
 /* The location from which a PC relative jump should be calculated,
index be127c0367a2ec6a5fcc210ce70b0a0fddb8e1e3..c011bfb78b3cfbb4c0e8fe62b1221c2a739dd883 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-mn10300.c -- Assembler code for the Matsushita 10300
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -1992,21 +1992,6 @@ md_apply_fix3 (fixP, valP, seg)
     fixP->fx_done = 1;
 }
 
-/* Return nonzero if the fixup in FIXP will require a relocation,
-   even it if appears that the fixup could be completely handled
-   within GAS.  */
-
-int
-mn10300_force_relocation (fixp)
-     struct fix *fixp;
-{
-  if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
-    return 1;
-
-  return S_FORCE_RELOC (fixp->fx_addsy);
-}
-
 /* Return zero if the fixup in fixp should be left alone and not
    adjusted.  */
 
index 69b752e5ede4bbe2d898e372a1e2d02224fe9c33..736f93b29922821c011391eddc9f4c1ee3a0fc81 100644 (file)
@@ -1,5 +1,6 @@
 /* tc-mn10300.h -- Header file for tc-mn10300.c.
-   Copyright 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 2000, 2001, 2002, 2003
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
    visible symbols can be overridden.  */
 #define EXTERN_FORCE_RELOC 0
 
-/* For fixup and relocation handling.  */
-#define TC_FORCE_RELOCATION(fixp) mn10300_force_relocation (fixp)
-extern int mn10300_force_relocation PARAMS ((struct fix *));
-
 /* Do not adjust relocations involving symbols in code sections,
    because it breaks linker relaxations.  This could be fixed in the
    linker, but this fix is simpler, and it pretty much only affects
    object size a little bit.  */
-#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
-  (! SEG_NORMAL (SEG)                          \
-   || ((SEG)->flags & SEC_CODE) != 0)
+#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEC) \
+  (((SEC)->flags & SEC_CODE) != 0              \
+   || ! SEG_NORMAL (SEC)                       \
+   || TC_FORCE_RELOCATION (FIX))
 
 /* We validate subtract arguments within tc_gen_reloc(), so don't
    report errors at this point.  */
index 726b583d7422a7697cc9ff57a97af79c863361b2..091ef27ccc297f56d0c54cc7fda31076c5359555 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-openrisc.c -- Assembler for the OpenRISC family.
-   Copyright 2001, 2002 Free Software Foundation.
+   Copyright 2001, 2002, 2003 Free Software Foundation.
    Contributed by Johan Rydberg, jrydberg@opencores.org
 
    This file is part of GAS, the GNU Assembler.
@@ -398,23 +398,6 @@ md_cgen_lookup_reloc (insn, operand, fixP)
 
   return BFD_RELOC_NONE;
 }
-
-/* See whether we need to force a relocation into the output file.
-   This is used to force out switch and PC relative relocations when
-   relaxing.  */
-
-int
-openrisc_force_relocation (fix)
-     fixS * fix ATTRIBUTE_UNUSED;
-{
-  if (fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
-    return 1;
-
-  return S_FORCE_RELOC (fix->fx_addsy);
-}
-
-
 \f
 /* Write a value out to the object file, using the appropriate endianness.  */
 
index 24db9ab912c675120f68c0dddd78310661a15430..b822800efdef3e5e49aa099ebbfa663b58932260 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-openrisc.h -- Header file for tc-openrisc.c.
-   Copyright 2001, 2002 Free Software Foundation, Inc.
+   Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -55,10 +55,6 @@ extern const char openrisc_comment_chars [];
 extern bfd_boolean openrisc_fix_adjustable PARAMS ((struct fix *));
 #define tc_fix_adjustable(FIX) openrisc_fix_adjustable (FIX)
 
-/* When relaxing, we need to emit various relocs we otherwise wouldn't.  */
-extern int openrisc_force_relocation PARAMS ((struct fix *));
-#define TC_FORCE_RELOCATION(fix) openrisc_force_relocation (fix)
-
 #define tc_gen_reloc gas_cgen_tc_gen_reloc
 
 /* Call md_pcrel_from_section(), not md_pcrel_from().  */
index 4e6c92d889d625418d0b38319255b25d37076438..7d0a07d43de2d02b7275beb5f3743431f25e2a65 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is tc-pj.h
-   Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
 
    Contributed by Steve Chamberlain of Transmeta, sac@pobox.com
 
@@ -52,12 +52,6 @@ arelent *tc_gen_reloc PARAMS((asection *, struct fix *));
    visible symbols can be overridden.  */
 #define EXTERN_FORCE_RELOC 0
 
-/* Always leave vtable relocs untouched in the output.  */
-#define TC_FORCE_RELOCATION(FIX)                                       \
-          ((FIX)->fx_r_type == BFD_RELOC_VTABLE_INHERIT                \
-          || (FIX)->fx_r_type == BFD_RELOC_VTABLE_ENTRY                \
-          || S_FORCE_RELOC ((FIX)->fx_addsy))
-
 /* Values passed to md_apply_fix3 don't include the symbol value.  */
 #define MD_APPLY_SYM_VALUE(FIX) 0
 
index ba058f667bb2a1565b8dc1abb161160d04b50028..8f298f3ae06859456b197724007634723bfd6b3a 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-ppc.c -- Assemble for the PowerPC or POWER (RS/6000)
-   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
@@ -5256,7 +5256,7 @@ ppc_force_relocation (fix)
                  <= fix->fx_frag->fr_address))))
     return 1;
 
-  return S_FORCE_RELOC (fix->fx_addsy);
+  return generic_force_reloc (fix);
 }
 
 #endif /* OBJ_XCOFF */
@@ -5278,14 +5278,12 @@ ppc_force_relocation (fix)
     case BFD_RELOC_PPC_BA16_BRTAKEN:
     case BFD_RELOC_PPC_BA16_BRNTAKEN:
     case BFD_RELOC_PPC64_TOC:
-    case BFD_RELOC_VTABLE_INHERIT:
-    case BFD_RELOC_VTABLE_ENTRY:
       return 1;
     default:
       break;
     }
 
-  return S_FORCE_RELOC (fix->fx_addsy);
+  return generic_force_reloc (fix);
 }
 
 int
index d65c4065483fdbe782b43f4e418ec077685d6036..cdf3af29124fdf7fc26c7657cfcbe23b9f12fabd 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-s390.c -- Assemble for the S390
-   Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
 
    This file is part of GAS, the GNU Assembler.
@@ -1736,14 +1736,12 @@ tc_s390_force_relocation (fixp)
     case BFD_RELOC_390_GOTPLT32:
     case BFD_RELOC_390_GOTPLT64:
     case BFD_RELOC_390_GOTPLTENT:
-    case BFD_RELOC_VTABLE_INHERIT:
-    case BFD_RELOC_VTABLE_ENTRY:
       return 1;
     default:
       break;;
     }
 
-  return S_FORCE_RELOC (fixp->fx_addsy);
+  return generic_force_reloc (fixp);
 }
 
 /* Apply a fixup to the object code.  This is called for all the
index e9b5d0d26c1542c62e0de3d32f7dcd7be8987df0..fcc5b751600051903a302a4e5514e3c11d924a38 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-sh.c -- Assemble code for the Hitachi Super-H
-   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -3236,16 +3236,14 @@ sh_force_relocation (fix)
     return 0;
 
   /* Make sure some relocations get emitted.  */
-  if (fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY
-      || fix->fx_r_type == BFD_RELOC_SH_LOOP_START
+  if (fix->fx_r_type == BFD_RELOC_SH_LOOP_START
       || fix->fx_r_type == BFD_RELOC_SH_LOOP_END
       || fix->fx_r_type == BFD_RELOC_SH_TLS_GD_32
       || fix->fx_r_type == BFD_RELOC_SH_TLS_LD_32
       || fix->fx_r_type == BFD_RELOC_SH_TLS_IE_32
       || fix->fx_r_type == BFD_RELOC_SH_TLS_LDO_32
       || fix->fx_r_type == BFD_RELOC_SH_TLS_LE_32
-      || S_FORCE_RELOC (fix->fx_addsy))
+      || generic_force_reloc (fix))
     return 1;
 
   if (! sh_relax)
@@ -3705,7 +3703,7 @@ md_pcrel_from_section (fixP, sec)
 {
   if (! sh_local_pcrel (fixP)
       && fixP->fx_addsy != (symbolS *) NULL
-      && (S_FORCE_RELOC (fixP->fx_addsy)
+      && (generic_force_reloc (fixP)
          || S_GET_SEGMENT (fixP->fx_addsy) != sec))
     {
       /* The symbol is undefined (or is defined but not in this section,
index 2324285bb3f059582de67414ba7091b925b74e82..6537a6dda3356c6b45e7670ecbb686c5c2a6cab3 100644 (file)
@@ -1,6 +1,6 @@
 /* This file is tc-sh.h
-   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
-   Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+   2003 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -85,8 +85,9 @@ extern int sh_force_relocation PARAMS ((struct fix *));
        || (FIX)->fx_r_type == BFD_RELOC_8              \
        || SWITCH_TABLE_CONS (FIX)))
 
-#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG)         \
-  (! SEG_NORMAL (SEG)                                  \
+#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEC)         \
+  (! SEG_NORMAL (SEC)                                  \
+   || TC_FORCE_RELOCATION (FIX)                                \
    || (sh_relax && SWITCH_TABLE (FIX)))
 
 /* Don't complain when we leave fx_subsy around.  */
@@ -237,8 +238,7 @@ extern bfd_boolean sh_fix_adjustable PARAMS ((struct fix *));
 /* This keeps the subtracted symbol around, for use by PLT_PCREL
    relocs.  */
 #define TC_FORCE_RELOCATION_SUB_ABS(FIX)               \
-  ((FIX)->fx_r_type == BFD_RELOC_32_PLT_PCREL          \
-   || S_FORCE_RELOC ((FIX)->fx_subsy))
+  ((FIX)->fx_r_type == BFD_RELOC_32_PLT_PCREL)
 
 /* Don't complain when we leave fx_subsy around.  */
 #undef TC_VALIDATE_FIX_SUB
index c5758d2947fe5b9975b074c0432acc35d74376bb..1fb8e765b0c1075e18224dd49ff6aea311f78097 100644 (file)
@@ -107,8 +107,9 @@ extern int sh64_target_mach PARAMS ((void));
    || TC_FORCE_RELOCATION (FIX))
 
 #undef TC_FORCE_RELOCATION_SUB_SAME
-#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG)         \
-  (! SEG_NORMAL (SEG)                                  \
+#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEC)         \
+  (! SEG_NORMAL (SEC)                                  \
+   || TC_FORCE_RELOCATION (FIX)                                \
    || (sh_relax && SWITCH_TABLE (FIX))                 \
    || *symbol_get_tc ((FIX)->fx_addsy) != NULL)
 
index c9ea5e2d0ebdcf8708a67978bbc5d514b2a50bf5..da9252b6ef0d7b0e53c05c2a8cbbd7fe890e77d5 100644 (file)
@@ -1,6 +1,6 @@
 /* tc-sparc.c -- Assemble for the SPARC
    Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002
+   1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
    This file is part of GAS, the GNU Assembler.
 
@@ -3329,7 +3329,7 @@ tc_gen_reloc (section, fixp)
       switch (code)
        {
        case BFD_RELOC_32_PCREL_S2:
-         if (S_FORCE_RELOC (fixp->fx_addsy))
+         if (generic_force_reloc (fixp))
            code = BFD_RELOC_SPARC_WPLT30;
          break;
        case BFD_RELOC_HI22:
@@ -4349,16 +4349,3 @@ cons_fix_new_sparc (frag, where, nbytes, exp)
 
   fix_new_exp (frag, where, (int) nbytes, exp, 0, r);
 }
-
-#ifdef OBJ_ELF
-int
-elf32_sparc_force_relocation (fixp)
-     struct fix *fixp;
-{
-  if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
-    return 1;
-
-  return S_FORCE_RELOC (fixp->fx_addsy);
-}
-#endif
index 62be7495b350a360565685907cb09521c398a945..1d44506918a6704eeb4892756bedf26a12065316 100644 (file)
@@ -1,6 +1,6 @@
 /* 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 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -69,11 +69,6 @@ extern void sparc_handle_align PARAMS ((struct frag *));
 
 #define MAX_MEM_FOR_RS_ALIGN_CODE  (3 + 4 + 4)
 
-#ifdef OBJ_ELF
-#define TC_FORCE_RELOCATION(FIX) elf32_sparc_force_relocation(FIX)
-extern int elf32_sparc_force_relocation PARAMS ((struct fix *));
-#endif
-
 /* I know that "call 0" fails in sparc-coff if this doesn't return 1.  I
    don't know about other relocation types, or other formats, yet.  */
 #ifdef OBJ_COFF
@@ -112,7 +107,7 @@ extern int elf32_sparc_force_relocation PARAMS ((struct fix *));
           && (FIX)->fx_r_type != BFD_RELOC_LO10                        \
           && (FIX)->fx_r_type != BFD_RELOC_SPARC13                     \
           && ((FIX)->fx_r_type != BFD_RELOC_32_PCREL_S2                \
-              || !S_FORCE_RELOC ((FIX)->fx_addsy))                     \
+              || !generic_force_reloc (FIX))                           \
           && ((FIX)->fx_pcrel                                          \
               || ((FIX)->fx_subsy != NULL                              \
                   && (S_GET_SEGMENT ((FIX)->fx_subsy)                  \
index cdc3940f04fd30db4f611f81d6ac1e68367eb612..590dc0a28d2deb3ce0d56d7de97c0b53f51e7821 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-v850.c -- Assembler code for the NEC V850
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -2474,10 +2474,6 @@ int
 v850_force_relocation (fixP)
      struct fix *fixP;
 {
-  if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
-    return 1;
-
   if (fixP->fx_r_type == BFD_RELOC_V850_LONGCALL
       || fixP->fx_r_type == BFD_RELOC_V850_LONGJUMP)
     return 1;
@@ -2490,5 +2486,5 @@ v850_force_relocation (fixP)
          || fixP->fx_r_type >= BFD_RELOC_UNUSED))
     return 1;
 
-  return S_FORCE_RELOC (fixP->fx_addsy);
+  return generic_force_reloc (fixP);
 }
index cf57bd9edcc214b2af47987e6a23126a6f8a663e..e7b6efd96ed3f9fef5befce2881a0fce18c50360 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-xstormy16.c -- Assembler for the Sanyo XSTORMY16.
-   Copyright 2000, 2001, 2002 Free Software Foundation.
+   Copyright 2000, 2001, 2002, 2003 Free Software Foundation.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -380,18 +380,10 @@ int
 xstormy16_force_relocation (fix)
      fixS * fix;
 {
-  switch (fix->fx_r_type)
-    {
-    case BFD_RELOC_XSTORMY16_FPTR16:
-    case BFD_RELOC_VTABLE_INHERIT:
-    case BFD_RELOC_VTABLE_ENTRY:
-      return 1;
-
-    default:
-      break;
-    }
+  if (fix->fx_r_type == BFD_RELOC_XSTORMY16_FPTR16)
+    return 1;
 
-  return S_FORCE_RELOC (fix->fx_addsy);
+  return generic_force_reloc (fix);
 }
 
 /* Return true if a relocation against a symbol may be replaced with
index f88e6b21737aa910b1dde16dce7dd82e591b58d0..afff9f93d77347b5aa82f24e808b19dfd9576daf 100644 (file)
@@ -1,6 +1,6 @@
 \input texinfo
 @c  Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-@c  2001, 2002
+@c  2001, 2002, 2003
 @c  Free Software Foundation, Inc.
 @setfilename internals.info
 @node Top
@@ -1294,12 +1294,13 @@ symbol in the current section.  If undefined, fixups that are not
 returns non-zero, will emit relocs.
 
 @item TC_FORCE_RELOCATION_SUB_SAME (@var{fix}, @var{seg})
-@cindex TC_FORCE_RELOCATION_SUB
+@cindex TC_FORCE_RELOCATION_SUB_SAME
 This macro controls resolution of fixup expressions involving the
 difference of two symbols in the same section.  If this macro returns zero,
 the subtrahend will be resolved and @code{fx_subsy} set to @code{NULL} for
 @code{md_apply_fix3}.  If undefined, the default of
-@w{@code{! SEG_NORMAL (@var{seg})}} will be used.
+@w{@code{! SEG_NORMAL (@var{seg}) || TC_FORCE_RELOCATION (@var{fix})}} will
+be used.
 
 @item TC_FORCE_RELOCATION_SUB_ABS (@var{fix})
 @cindex TC_FORCE_RELOCATION_SUB_ABS
@@ -1324,13 +1325,13 @@ to @code{md_apply_fix3}.  If the macro is undefined, or returns non-zero, the
 symbol value will be included.  For ELF, a suitable definition might simply be
 @code{0}, because ELF relocations don't include the symbol value in the addend.
 
-@item S_FORCE_RELOC (@var{sym})
+@item S_FORCE_RELOC (@var{sym}, @var{strict})
 @cindex S_FORCE_RELOC
 This macro (or function, for @code{BFD_ASSEMBLER} gas) returns true for symbols
 that should not be reduced to section symbols or eliminated from expressions,
 because they may be overridden by the linker.  ie. for symbols that are
-undefined, common or weak, or for ELF assemblers that support ELF shared
-library linking semantics, global.
+undefined or common, and when @var{strict} is set, weak, or global (for ELF
+assemblers that support ELF shared library linking semantics).
 
 @item EXTERN_FORCE_RELOC
 @cindex EXTERN_FORCE_RELOC
index fd969f029b12636d70b50d88d6a9fb4234b0d9da..4b02b99925ab8601748e88e2444f13dae9e330f7 100644 (file)
@@ -1807,15 +1807,17 @@ S_IS_DEFINED (s)
    symbols or eliminated from expressions, because they may be
    overridden by the linker.  */
 int
-S_FORCE_RELOC (s)
+S_FORCE_RELOC (s, strict)
      symbolS *s;
+     int strict;
 {
   if (LOCAL_SYMBOL_CHECK (s))
     return ((struct local_symbol *) s)->lsy_section == undefined_section;
 
-  return ((s->bsym->flags & BSF_WEAK) != 0
-         || (EXTERN_FORCE_RELOC
-             && (s->bsym->flags & BSF_GLOBAL) != 0)
+  return ((strict
+          && ((s->bsym->flags & BSF_WEAK) != 0
+              || (EXTERN_FORCE_RELOC
+                  && (s->bsym->flags & BSF_GLOBAL) != 0)))
          || s->bsym->section == undefined_section
          || bfd_is_com_section (s->bsym->section));
 }
index 914a9308f23a6eb36ac69f99e09435f0dc50f7df..65fb8492fd75bafb34ac9095a8049438137f923d 100644 (file)
@@ -1,6 +1,6 @@
 /* symbols.h -
    Copyright 1987, 1990, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001,
-   2002 Free Software Foundation, Inc.
+   2002, 2003 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -90,7 +90,7 @@ extern int S_IS_EXTERNAL PARAMS ((symbolS *));
 extern int S_IS_WEAK PARAMS ((symbolS *));
 extern int S_IS_COMMON PARAMS ((symbolS *));
 extern int S_IS_DEFINED PARAMS ((symbolS *));
-extern int S_FORCE_RELOC PARAMS ((symbolS *));
+extern int S_FORCE_RELOC PARAMS ((symbolS *, int));
 extern int S_IS_DEBUG PARAMS ((symbolS *));
 extern int S_IS_LOCAL PARAMS ((symbolS *));
 extern int S_IS_EXTERN PARAMS ((symbolS *));
index f46bbacd31f08c85e7d379939d4362ba1b3db739..27fd0eb41213972238563b15abdcb7c5d15b08ae 100644 (file)
@@ -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
+   1998, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -34,7 +34,7 @@
 
 #ifndef TC_FORCE_RELOCATION
 #define TC_FORCE_RELOCATION(FIX)               \
-  (S_FORCE_RELOC ((FIX)->fx_addsy))
+  (generic_force_reloc (FIX))
 #endif
 
 #ifndef TC_FORCE_RELOCATION_ABS
@@ -51,7 +51,7 @@
 
 #ifndef TC_FORCE_RELOCATION_SUB_SAME
 #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
-  (! SEG_NORMAL (SEG))
+  (! SEG_NORMAL (SEG) || TC_FORCE_RELOCATION (FIX))
 #endif
 
 #ifndef TC_FORCE_RELOCATION_SUB_ABS
@@ -374,6 +374,19 @@ fix_new_exp (frag, where, size, exp, pcrel, r_type)
   return fix_new_internal (frag, where, size, add, sub, off, pcrel, r_type);
 }
 
+/* Generic function to determine whether a fixup requires a relocation.  */
+int
+generic_force_reloc (fix)
+     fixS *fix;
+{
+#ifdef BFD_ASSEMBLER
+  if (fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT
+      || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
+    return 1;
+#endif
+  return S_FORCE_RELOC (fix->fx_addsy, fix->fx_subsy == NULL);
+}
+
 /* Append a string onto another string, bumping the pointer along.  */
 void
 append (charPP, fromP, length)
@@ -823,7 +836,7 @@ adjust_reloc_syms (abfd, sec, xxx)
 
        /* If the symbol is undefined, common, weak, or global (ELF
           shared libs), we can't replace it with the section symbol.  */
-       if (S_FORCE_RELOC (fixp->fx_addsy))
+       if (S_FORCE_RELOC (fixp->fx_addsy, 1))
          continue;
 
        /* Is there some other (target cpu dependent) reason we can't adjust
This page took 0.084629 seconds and 4 git commands to generate.