Allow target files access to default TC_FORCE_RELOCATION defines
authorAlan Modra <amodra@gmail.com>
Mon, 15 May 2017 23:13:24 +0000 (08:43 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 16 May 2017 01:05:02 +0000 (10:35 +0930)
* write.c (GENERIC_FORCE_RELOCATION_LOCAL): Define.
(TC_FORCE_RELOCATION_LOCAL): Use it.
(GENERIC_FORCE_RELOCATION_SUB_SAME): Define.
(TC_FORCE_RELOCATION_SUB_SAME): Use it.
* config/tc-arm.h (TC_FORCE_RELOCATION_LOCAL,
TC_FORCE_RELOCATION_SUB_SAME): Use GENERIC defines.
* config/tc-aarch64.h: Similarly.
* config/tc-avr.h: Similarly.
* config/tc-cris.h: Similarly.
* config/tc-i386.h: Similarly.
* config/tc-i960.h: Similarly.
* config/tc-ia64.h: Similarly.
* config/tc-microblaze.h: Similarly.
* config/tc-mips.h: Similarly.
* config/tc-msp430.h: Similarly.
* config/tc-nds32.h: Similarly.
* config/tc-pru.h: Similarly.
* config/tc-riscv.h: Similarly.
* config/tc-rl78.h: Similarly.
* config/tc-s390.h: Similarly.
* config/tc-sh.h: Similarly.
* config/tc-sh64.h: Similarly.
* config/tc-sparc.h: Similarly.
* config/tc-xtensa.h: Similarly.
* config/tc-mn10300.h: Similarly.
(GENERIC_FORCE_RELOCATION_LOCAL): Define.
* config/tc-msp430.c (msp430_force_relocation_local): Modify to
be addition to rather than replacement of standard
TC_FORCE_RELOCATION_LOCAL.

23 files changed:
gas/ChangeLog
gas/config/tc-aarch64.h
gas/config/tc-arm.h
gas/config/tc-avr.h
gas/config/tc-cris.h
gas/config/tc-i386.h
gas/config/tc-i960.h
gas/config/tc-ia64.h
gas/config/tc-microblaze.h
gas/config/tc-mips.h
gas/config/tc-mn10300.h
gas/config/tc-msp430.c
gas/config/tc-msp430.h
gas/config/tc-nds32.h
gas/config/tc-pru.h
gas/config/tc-riscv.h
gas/config/tc-rl78.h
gas/config/tc-s390.h
gas/config/tc-sh.h
gas/config/tc-sh64.h
gas/config/tc-sparc.h
gas/config/tc-xtensa.h
gas/write.c

index 9d0fa57082e2e4bd4b8c57b3db9d1e28bb4f2f70..9b0ea23f4755a0e42bde74d39993ebc793e1d853 100644 (file)
@@ -1,3 +1,35 @@
+2017-05-16  Alan Modra  <amodra@gmail.com>
+
+       * write.c (GENERIC_FORCE_RELOCATION_LOCAL): Define.
+       (TC_FORCE_RELOCATION_LOCAL): Use it.
+       (GENERIC_FORCE_RELOCATION_SUB_SAME): Define.
+       (TC_FORCE_RELOCATION_SUB_SAME): Use it.
+       * config/tc-arm.h (TC_FORCE_RELOCATION_LOCAL,
+       TC_FORCE_RELOCATION_SUB_SAME): Use GENERIC defines.
+       * config/tc-aarch64.h: Similarly.
+       * config/tc-avr.h: Similarly.
+       * config/tc-cris.h: Similarly.
+       * config/tc-i386.h: Similarly.
+       * config/tc-i960.h: Similarly.
+       * config/tc-ia64.h: Similarly.
+       * config/tc-microblaze.h: Similarly.
+       * config/tc-mips.h: Similarly.
+       * config/tc-msp430.h: Similarly.
+       * config/tc-nds32.h: Similarly.
+       * config/tc-pru.h: Similarly.
+       * config/tc-riscv.h: Similarly.
+       * config/tc-rl78.h: Similarly.
+       * config/tc-s390.h: Similarly.
+       * config/tc-sh.h: Similarly.
+       * config/tc-sh64.h: Similarly.
+       * config/tc-sparc.h: Similarly.
+       * config/tc-xtensa.h: Similarly.
+       * config/tc-mn10300.h: Similarly.
+       (GENERIC_FORCE_RELOCATION_LOCAL): Define.
+       * config/tc-msp430.c (msp430_force_relocation_local): Modify to
+       be addition to rather than replacement of standard
+       TC_FORCE_RELOCATION_LOCAL.
+
 2017-05-15  Nick Clifton  <nickc@redhat.com>
 
        PR gas/21458
index d5bcce2fda12a5c6c6d345981c1c9d0fb648a2f6..5bf1399bfd610b15ab952900af79a4b984b22f46 100644 (file)
@@ -109,10 +109,9 @@ void aarch64_copy_symbol_attributes (symbolS *, symbolS *);
    pcrel, but it is easier to be safe than sorry.  */
 
 #define TC_FORCE_RELOCATION_LOCAL(FIX)                 \
-  (!(FIX)->fx_pcrel                                    \
+  (GENERIC_FORCE_RELOCATION_LOCAL (FIX)                        \
    || (FIX)->fx_r_type == BFD_RELOC_64                 \
-   || (FIX)->fx_r_type == BFD_RELOC_32                 \
-   || TC_FORCE_RELOCATION (FIX))
+   || (FIX)->fx_r_type == BFD_RELOC_32)
 
 #define TC_CONS_FIX_NEW(f,w,s,e,r) cons_fix_new_aarch64 ((f), (w), (s), (e))
 
index ebcf27bef839bc8f51a8b00d30f53f88ae558e47..53c49863b7a39bba6d1491a379547e9d5294a062 100644 (file)
@@ -200,17 +200,17 @@ void arm_copy_symbol_attributes (symbolS *, symbolS *);
    pcrel, but it is easier to be safe than sorry.  */
 
 #define TC_FORCE_RELOCATION_LOCAL(FIX)                 \
-  (!(FIX)->fx_pcrel                                    \
+  (GENERIC_FORCE_RELOCATION_LOCAL (FIX)                        \
    || (FIX)->fx_r_type == BFD_RELOC_ARM_GOT32          \
    || (FIX)->fx_r_type == BFD_RELOC_32                 \
-   || ((FIX)->fx_addsy != NULL && S_IS_WEAK ((FIX)->fx_addsy)) \
-   || TC_FORCE_RELOCATION (FIX))
+   || ((FIX)->fx_addsy != NULL                         \
+       && S_IS_WEAK ((FIX)->fx_addsy)))
 
 /* Force output of R_ARM_REL32 relocations against thumb function symbols.
    This is needed to ensure the low bit is handled correctly.  */
 #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
-  (THUMB_IS_FUNC ((FIX)->fx_addsy)             \
-   || !SEG_NORMAL (SEG))
+  (GENERIC_FORCE_RELOCATION_SUB_SAME (FIX, SEG)        \
+   || THUMB_IS_FUNC ((FIX)->fx_addsy))
 
 #define TC_FORCE_RELOCATION_ABS(FIX)                   \
   (((FIX)->fx_pcrel                                    \
index 88b7f99d251a186a41e79636cf3754e8879ed47a..399656fa2ba0f4fbb4e2a01b93e27d1c3166b03d 100644 (file)
@@ -123,7 +123,8 @@ extern void avr_cons_fix_new (fragS *,int, int, expressionS *,
    even when the value can be resolved locally. Do that if linkrelax is turned on */
 #define TC_FORCE_RELOCATION(fix)       avr_force_relocation (fix)
 #define TC_FORCE_RELOCATION_SUB_SAME(fix, seg) \
-  (! SEG_NORMAL (seg) || avr_force_relocation (fix))
+  (GENERIC_FORCE_RELOCATION_SUB_SAME (fix, seg)        \
+   || avr_force_relocation (fix))
 extern int avr_force_relocation (struct fix *);
 
 /* Values passed to md_apply_fix don't include the symbol value.  */
index 8737232491e2f7ace5b04c2146eb0d3e3b743a3e..5e17c48f4dfd059e9b76cba421c33f479e751f7c 100644 (file)
@@ -93,9 +93,8 @@ extern int md_cris_force_relocation (struct fix *);
 /* Make sure we don't resolve fixups for which we want to emit dynamic
    relocations.  */
 #define TC_FORCE_RELOCATION_LOCAL(FIX)                 \
-  (!(FIX)->fx_pcrel                                    \
-   || IS_CRIS_PIC_RELOC ((FIX)->fx_r_type)             \
-   || TC_FORCE_RELOCATION (FIX))
+  (GENERIC_FORCE_RELOCATION_LOCAL (FIX)                        \
+   || IS_CRIS_PIC_RELOC ((FIX)->fx_r_type))
 
 /* For some reloc types, don't adjust fixups by reducing to a section
    symbol.  */
index 06228df1337a0008b63d834ede6d3dedf4202793..f54924c4382de8507fd4ef0ef08382bac800da13 100644 (file)
@@ -171,12 +171,11 @@ extern int tc_i386_fix_adjustable (struct fix *);
    they are not pcrel.  .*/
 
 #define TC_FORCE_RELOCATION_LOCAL(FIX)                         \
-  (!(FIX)->fx_pcrel                                            \
+  (GENERIC_FORCE_RELOCATION_LOCAL (FIX)                                \
    || (FIX)->fx_r_type == BFD_RELOC_386_PLT32                  \
    || (FIX)->fx_r_type == BFD_RELOC_386_GOTPC                  \
    || (FIX)->fx_r_type == BFD_RELOC_X86_64_GOTPCRELX           \
-   || (FIX)->fx_r_type == BFD_RELOC_X86_64_REX_GOTPCRELX       \
-   || TC_FORCE_RELOCATION (FIX))
+   || (FIX)->fx_r_type == BFD_RELOC_X86_64_REX_GOTPCRELX)
 
 extern int i386_parse_name (char *, expressionS *, char *);
 #define md_parse_name(s, e, m, c) i386_parse_name (s, e, c)
index 561d8687d49a3cf15abaa5087e5dd1ec946143b0..96cdd319f2fd19b14c855a172cff932abfff71d1 100644 (file)
@@ -122,8 +122,8 @@ struct relocation_info
 /* Makes no sense to use the difference of 2 arbitrary symbols
    as the target of a call instruction.  */
 #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
-  ((FIX)->fx_tcbit                             \
-   || ! SEG_NORMAL (SEG)                       \
+  (GENERIC_FORCE_RELOCATION_SUB_SAME (FIX, SEG)        \
+   || (FIX)->fx_tcbit                          \
    || TC_FORCE_RELOCATION (FIX))
 
 /* reloc_callj() may replace a 'call' with a 'calls' or a
@@ -136,8 +136,7 @@ extern int reloc_callj (struct fix *);
    || reloc_callj (FIX))
 
 #define TC_FORCE_RELOCATION_LOCAL(FIX)         \
-  (!(FIX)->fx_pcrel                            \
-   || TC_FORCE_RELOCATION (FIX)                \
+  (GENERIC_FORCE_RELOCATION_LOCAL (FIX)                \
    || reloc_callj (FIX))
 
 #ifdef OBJ_COFF
index 5f906dd8ef0e5c51be0881765b52dd797e0905b5..7e044413e037e410d36fa5474fa3577c8ff7ed71 100644 (file)
@@ -320,9 +320,8 @@ typedef struct unwind_record
 
 #define TC_FORCE_RELOCATION_LOCAL(FIX)                 \
   ((FIX)->fx_r_type != BFD_RELOC_UNUSED                        \
-   && (!(FIX)->fx_pcrel                                        \
-       || (FIX)->fx_r_type == BFD_RELOC_IA64_PLTOFF22  \
-       || TC_FORCE_RELOCATION (FIX)))
+   && (GENERIC_FORCE_RELOCATION_LOCAL (FIX)            \
+       || (FIX)->fx_r_type == BFD_RELOC_IA64_PLTOFF22))
 
 /* VMS backtraces expect dwarf version 3.  */
 #ifdef TE_VMS
index c0e2d972e0ccac1f52e3611845bd39a6e3be1762..0e43dfa216378b1f5194bff10054574835b7ab77 100644 (file)
@@ -44,13 +44,12 @@ extern bfd_reloc_code_real_type parse_cons_expression_microblaze
 #define TC_FORCE_RELOCATION_SECTION(FIXP,SEG) 1
 #define UNDEFINED_DIFFERENCE_OK 1
 
-#define TC_FORCE_RELOCATION_LOCAL(FIX) \
-  (!(FIX)->fx_pcrel                    \
-   || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_64_GOT  \
-   || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_64_PLT  \
+#define TC_FORCE_RELOCATION_LOCAL(FIX)                         \
+  (GENERIC_FORCE_RELOCATION_LOCAL (FIX)                                \
+   || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_64_GOT          \
+   || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_64_PLT          \
    || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_64_GOTOFF       \
-   || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_32_GOTOFF       \
-   || TC_FORCE_RELOCATION (FIX))
+   || (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_32_GOTOFF)
 
 #define tc_fix_adjustable(X)  tc_microblaze_fix_adjustable(X)
 extern int tc_microblaze_fix_adjustable (struct fix *);
index 7b780c24f1f2911f6506ec3d4f7c2a6182ee4752..54e17e5513b397b167bc2508ba6e6ab07e59efc4 100644 (file)
@@ -140,7 +140,8 @@ extern int mips_fix_adjustable (struct fix *);
 extern int mips_force_relocation (struct fix *);
 
 #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
-  (! SEG_NORMAL (SEG) || mips_force_relocation (FIX))
+  (GENERIC_FORCE_RELOCATION_SUB_SAME (FIX, SEG) \
+   || mips_force_relocation (FIX))
 
 #define TC_FORCE_RELOCATION_ABS(FIX) mips_force_relocation_abs (FIX)
 extern bfd_boolean mips_force_relocation_abs (struct fix *);
index e1d3faa0c05340c566d43c772417c90ccde44a13..ff39646fc4704ec7a494ae15a8de517da67f2032 100644 (file)
 #define TC_FORCE_RELOCATION(FIX) mn10300_force_relocation (FIX)
 extern bfd_boolean mn10300_force_relocation (struct fix *);
 
+/* tc-mn10300.c uses TC_FORCE_RELOCATION_LOCAL, a macro that should
+   only appear in write.c.  The use is likely incorrect.  Duplicating
+   the definition here rather than expanding it in
+   TC_FORCE_RELOCATION_LOCAL at least ensures write.c changes will be
+   flagged immediately with a compile error.  */
+#define GENERIC_FORCE_RELOCATION_LOCAL(FIX)    \
+  (!(FIX)->fx_pcrel                            \
+   || TC_FORCE_RELOCATION (FIX))
+
 #define TC_FORCE_RELOCATION_LOCAL(FIX)                 \
-  (!(FIX)->fx_pcrel                                    \
+  (GENERIC_FORCE_RELOCATION_LOCAL (FIX)                        \
    || (FIX)->fx_r_type == BFD_RELOC_32_PLT_PCREL       \
    || (FIX)->fx_r_type == BFD_RELOC_MN10300_GOT32      \
-   || (FIX)->fx_r_type == BFD_RELOC_32_GOT_PCREL       \
-   || TC_FORCE_RELOCATION (FIX))
+   || (FIX)->fx_r_type == BFD_RELOC_32_GOT_PCREL)
 
 #define md_parse_name(NAME, EXPRP, MODE, NEXTCHARP) \
     mn10300_parse_name ((NAME), (EXPRP), (MODE), (NEXTCHARP))
@@ -63,8 +71,8 @@ void mn10300_cons_fix_new (fragS *, int, int, expressionS *,
    linker, but this fix is simpler, and it pretty much only affects
    object size a little bit.  */
 #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEC) \
-  (((SEC)->flags & SEC_CODE) != 0              \
-   || ! SEG_NORMAL (SEC)                       \
+  (GENERIC_FORCE_RELOCATION_SUB_SAME (FIX, SEC)        \
+   || ((SEC)->flags & SEC_CODE) != 0           \
    || (FIX)->fx_r_type == BFD_RELOC_MN10300_ALIGN \
    || TC_FORCE_RELOCATION (FIX))
 
index 10e5972d870d4435052b85d22148c7a3ffb81d5b..0430f2ec6e70ae228be67d6ad698e275c69daf2e 100644 (file)
@@ -3950,7 +3950,7 @@ md_pcrel_from_section (fixS * fixp, segT sec)
   return fixp->fx_frag->fr_address + fixp->fx_where;
 }
 
-/* Replaces standard TC_FORCE_RELOCATION_LOCAL.
+/* Addition to the standard TC_FORCE_RELOCATION_LOCAL.
    Now it handles the situation when relocations
    have to be passed to linker.  */
 int
@@ -3964,8 +3964,7 @@ msp430_force_relocation_local (fixS *fixp)
         && !msp430_enable_relax)
     return 1;
 
-  return (!fixp->fx_pcrel
-         || generic_force_reloc (fixp));
+  return 0;
 }
 
 
index 6789a1ec7d4d1a6bf736de3558188ba88bc94697..c996544b786af7ecc9eaba9167fc0c87f6abc341 100644 (file)
@@ -116,8 +116,9 @@ extern long md_pcrel_from_section (struct fix *, segT);
    msp430_relax_frag (SEG, FRAGP, STRETCH)
 extern long msp430_relax_frag (segT, fragS *, long);
 
-#define TC_FORCE_RELOCATION_LOCAL(FIX) \
-   msp430_force_relocation_local (FIX)
+#define TC_FORCE_RELOCATION_LOCAL(FIX)         \
+  (GENERIC_FORCE_RELOCATION_LOCAL (FIX)                \
+   || msp430_force_relocation_local (FIX))
 extern int msp430_force_relocation_local (struct fix *);
 
 /* We need to add reference symbols for .data/.bss.  */
@@ -159,9 +160,9 @@ extern bfd_boolean msp430_allow_local_subtract (expressionS *, expressionS *, se
    linker, but this fix is simpler, and it pretty much only affects
    object size a little bit.  */
 #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEC) \
-  (   ((SEC)->flags & SEC_CODE) != 0           \
+  (GENERIC_FORCE_RELOCATION_SUB_SAME (FIX, SEC)        \
+   || ((SEC)->flags & SEC_CODE) != 0           \
    || ((SEC)->flags & SEC_DEBUGGING) != 0      \
-   || ! SEG_NORMAL (SEC)                       \
    || TC_FORCE_RELOCATION (FIX))
 
 /* We validate subtract arguments within tc_gen_reloc(),
index 08f097c48e8d885cd90263f8de32d05f3310f9fa..d3d0c6a3892290da50c7254d85f2db6f90d675a0 100644 (file)
@@ -91,7 +91,8 @@ extern void tc_nds32_frame_initial_instructions (void);
 /* For DIFF relocations.  The default behavior is inconsistent with the
    asm internal document.  */
 #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEC)         \
-  (! SEG_NORMAL (SEC) || TC_FORCE_RELOCATION (FIX))
+  (GENERIC_FORCE_RELOCATION_SUB_SAME (FIX, SEC)                \
+   || TC_FORCE_RELOCATION (FIX))
 #define TC_FORCE_RELOCATION(fix)               nds32_force_relocation (fix)
 #define TC_VALIDATE_FIX_SUB(FIX,SEG)           nds32_validate_fix_sub (FIX,SEG)
 #define SET_SECTION_RELOCS(sec, relocs, n)     nds32_set_section_relocs (sec, relocs, n)
index e3f4300a4864304b5282b40b4c3c4b8a9b5c4fb6..2b3d9ce1e2b815382b513dad75ead8d0d04c03a3 100644 (file)
@@ -97,7 +97,7 @@ extern void pru_cons_fix_new (struct frag *frag, int where,
    linkrelax is turned on.  */
 #define TC_FORCE_RELOCATION(fix)       pru_force_relocation (fix)
 #define TC_FORCE_RELOCATION_SUB_SAME(fix, seg) \
-  (! SEG_NORMAL (seg) || pru_force_relocation (fix))
+  (GENERIC_FORCE_RELOCATION_SUB_SAME (fix, seg) || pru_force_relocation (fix))
 extern int pru_force_relocation (struct fix *);
 
 /* Do not use PC relative fixups and relocations for
index e92b3879a96e4fbe23f850e2ae69739c7c5bc36d..d79d30564cac4515be834f9bfaa722a9a80120af 100644 (file)
@@ -87,7 +87,9 @@ extern void riscv_pre_output_hook (void);
 
 /* Postpone text-section label subtraction calculation until linking, since
    linker relaxations might change the deltas.  */
-#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) ((SEG)->flags & SEC_CODE)
+#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
+  (GENERIC_FORCE_RELOCATION_SUB_SAME (FIX, SEG)        \
+   || ((SEG)->flags & SEC_CODE) != 0)
 #define TC_FORCE_RELOCATION_SUB_LOCAL(FIX, SEG) 1
 #define TC_VALIDATE_FIX_SUB(FIX, SEG) 1
 #define TC_FORCE_RELOCATION_LOCAL(FIX) 1
index cb2c708db06c173b653fbb86e86fa9b99e1edb0f..cf1c560345818a0457a983479a94006295a53748 100644 (file)
@@ -93,9 +93,9 @@ extern void rl78_elf_final_processing (void);
    linker, but this fix is simpler, and it pretty much only affects
    object size a little bit.  */
 #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEC) \
-  (   ((SEC)->flags & SEC_CODE) != 0           \
+  (GENERIC_FORCE_RELOCATION_SUB_SAME (FIX, SEC)        \
+   || ((SEC)->flags & SEC_CODE) != 0           \
    || ((SEC)->flags & SEC_DEBUGGING) != 0      \
-   || ! SEG_NORMAL (SEC)                       \
    || TC_FORCE_RELOCATION (FIX))
 
 #define DWARF2_USE_FIXED_ADVANCE_PC 1
index c6d85b6e97ddec32580044008235a63953f246bf..c29e23088ca9dd7f04072baffe9049b265cda68a 100644 (file)
@@ -28,7 +28,8 @@ extern int tc_s390_force_relocation (struct fix *);
 
 /* Don't resolve foo@PLT-bar to offset@PLT.  */
 #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
-  (! SEG_NORMAL (SEG) || TC_FORCE_RELOCATION (FIX))
+  (GENERIC_FORCE_RELOCATION_SUB_SAME (FIX, SEG)        \
+   || TC_FORCE_RELOCATION (FIX))
 
 #define tc_fix_adjustable(X)  tc_s390_fix_adjustable(X)
 extern int tc_s390_fix_adjustable (struct fix *);
index 4640dc5ecf2a22ec5f8e70cc066f2f30f36368ab..f9a2f074be295ed47a93f763d63e446d6d4942cc 100644 (file)
@@ -77,7 +77,7 @@ extern int sh_force_relocation (struct fix *);
        || (FIX)->fx_r_type == BFD_RELOC_8))
 
 #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEC)         \
-  (! SEG_NORMAL (SEC)                                  \
+  (GENERIC_FORCE_RELOCATION_SUB_SAME (FIX, SEC)                \
    || TC_FORCE_RELOCATION (FIX)                                \
    || (sh_relax && SWITCH_TABLE (FIX)))
 
@@ -204,11 +204,10 @@ extern bfd_boolean sh_fix_adjustable (struct fix *);
    can only be determined at link time.  */
 
 #define TC_FORCE_RELOCATION_LOCAL(FIX)                 \
-  (!(FIX)->fx_pcrel                                    \
+  (GENERIC_FORCE_RELOCATION_LOCAL (FIX)                        \
    || (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           \
-   || TC_FORCE_RELOCATION (FIX))
+   || (FIX)->fx_r_type == BFD_RELOC_SH_GOTPC)
 
 #define TC_FORCE_RELOCATION_SUB_LOCAL(FIX, SEG)                \
   ((!md_register_arithmetic && (SEG) == reg_section)   \
index 05b14440feedff466cb123a71eb3ca53fea389b5..67e1c217f3a5d97b05055c096236f83c8cbc72cf 100644 (file)
@@ -78,7 +78,7 @@ extern int sh64_target_mach (void);
 
 #undef TC_FORCE_RELOCATION_LOCAL
 #define TC_FORCE_RELOCATION_LOCAL(FIX)                 \
-  (!(FIX)->fx_pcrel                                    \
+  (GENERIC_FORCE_RELOCATION_LOCAL (FIX)                        \
    || (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    \
@@ -102,12 +102,11 @@ extern int sh64_target_mach (void);
    || (FIX)->fx_r_type == BFD_RELOC_SH_GOTPC_LOW16     \
    || (FIX)->fx_r_type == BFD_RELOC_SH_GOTPC_MEDLOW16  \
    || (FIX)->fx_r_type == BFD_RELOC_SH_GOTPC_MEDHI16   \
-   || (FIX)->fx_r_type == BFD_RELOC_SH_GOTPC_HI16      \
-   || TC_FORCE_RELOCATION (FIX))
+   || (FIX)->fx_r_type == BFD_RELOC_SH_GOTPC_HI16)
 
 #undef TC_FORCE_RELOCATION_SUB_SAME
 #define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEC)         \
-  (! SEG_NORMAL (SEC)                                  \
+  (GENERIC_FORCE_RELOCATION_SUB_SAME (FIX, SEC)                \
    || TC_FORCE_RELOCATION (FIX)                                \
    || (sh_relax && SWITCH_TABLE (FIX))                 \
    || *symbol_get_tc ((FIX)->fx_addsy) != NULL)
index 2b617d42ad646af3c209f288589a4def1cbf6374..3dd2483cd7183d4a838cfe895d86f1eec09b9c52 100644 (file)
@@ -94,10 +94,9 @@ extern void sparc_handle_align (struct frag *);
    the .o file.  */
 
 #define TC_FORCE_RELOCATION_LOCAL(FIX)         \
-  (!(FIX)->fx_pcrel                            \
+  (GENERIC_FORCE_RELOCATION_LOCAL (FIX)                \
    || (sparc_pic_code                          \
-       && S_IS_EXTERNAL ((FIX)->fx_addsy))     \
-   || TC_FORCE_RELOCATION (FIX))
+       && S_IS_EXTERNAL ((FIX)->fx_addsy)))
 #endif
 
 #ifdef OBJ_ELF
index 50e464073ebbd816794df92cdc058bc4b7376e86..257ca057bed1816c79cc6aa129cf64c866f5b68d 100644 (file)
@@ -345,7 +345,8 @@ extern char *xtensa_section_rename (const char *);
 #define TC_FRAG_INIT(frag)             xtensa_frag_init (frag)
 #define TC_FORCE_RELOCATION(fix)       xtensa_force_relocation (fix)
 #define TC_FORCE_RELOCATION_SUB_SAME(fix, seg) \
-  (! SEG_NORMAL (seg) || xtensa_force_relocation (fix))
+  (GENERIC_FORCE_RELOCATION_SUB_SAME (fix, seg)        \
+   || xtensa_force_relocation (fix))
 #define        TC_VALIDATE_FIX_SUB(fix, seg)   xtensa_validate_fix_sub (fix)
 #define NO_PSEUDO_DOT                  xtensa_check_inside_bundle ()
 #define tc_canonicalize_symbol_name(s) xtensa_section_rename (s)
index d570b6f5baf8ff9e944cc8213fbed0f2270f447f..1242cbf99856d393eb3e80e5ff58e8cfaecc6056 100644 (file)
   (TC_FORCE_RELOCATION (FIX))
 #endif
 
-#ifndef TC_FORCE_RELOCATION_LOCAL
-#define TC_FORCE_RELOCATION_LOCAL(FIX)         \
+#define GENERIC_FORCE_RELOCATION_LOCAL(FIX)    \
   (!(FIX)->fx_pcrel                            \
    || TC_FORCE_RELOCATION (FIX))
+#ifndef TC_FORCE_RELOCATION_LOCAL
+#define TC_FORCE_RELOCATION_LOCAL GENERIC_FORCE_RELOCATION_LOCAL
 #endif
 
+#define GENERIC_FORCE_RELOCATION_SUB_SAME(FIX, SEG)    \
+  (!SEG_NORMAL (SEG))
 #ifndef TC_FORCE_RELOCATION_SUB_SAME
-#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \
-  (! SEG_NORMAL (SEG))
+#define TC_FORCE_RELOCATION_SUB_SAME GENERIC_FORCE_RELOCATION_SUB_SAME
 #endif
 
 #ifndef md_register_arithmetic
This page took 0.036868 seconds and 4 git commands to generate.