* 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>
+
+ * 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
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 */
/* 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.
/* 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)
/* 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.
/* 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) \
/* 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.
/* 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) \
/* 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.
/* 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
{
/* 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.
/* 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)
/* 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.
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:
break;
}
- return S_FORCE_RELOC (f->fx_addsy);
+ return generic_force_reloc (f);
}
/* Return true if we can partially resolve a relocation now. */
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)
/* 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)
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)
|| 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
/* 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.
{
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:
;
}
- 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
/* 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.
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);
-}
#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
/* 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.
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;
/* 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.
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 *));
/* 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.
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. */
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(). */
/* 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.
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. */
/* 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.
/* 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
/* 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.
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
}
}
-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;
/* 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.
#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
/* 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)
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.
break;
}
- return S_FORCE_RELOC (fix->fx_addsy);
+ return generic_force_reloc (fix);
}
/* Decide from what point a pc-relative relocation is relative to,
/* 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.
{
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:
break;
}
- return S_FORCE_RELOC (fix->fx_addsy);
+ return generic_force_reloc (fix);
}
void
/* 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.
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)
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
/* 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.
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)
/* 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.
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
/* 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.
# 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 */
#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
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
#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;
/* 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.
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;
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,
/* 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.
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. */
/* 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. */
/* 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.
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. */
/* 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.
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(). */
/* 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
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
/* 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.
<= fix->fx_frag->fr_address))))
return 1;
- return S_FORCE_RELOC (fix->fx_addsy);
+ return generic_force_reloc (fix);
}
#endif /* OBJ_XCOFF */
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
/* 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.
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
/* 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.
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)
{
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,
/* 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.
|| (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. */
/* 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
|| 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)
/* 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.
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:
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
/* 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.
#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
&& (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) \
/* 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.
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;
|| fixP->fx_r_type >= BFD_RELOC_UNUSED))
return 1;
- return S_FORCE_RELOC (fixP->fx_addsy);
+ return generic_force_reloc (fixP);
}
/* 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.
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
\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
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
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
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));
}
/* 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.
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 *));
/* 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.
#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
#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
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)
/* 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