+2021-07-14 Alan Modra <amodra@gmail.com>
+
+ * write.c (TC_VALIDATE_FIX_SUB): Default to 0.
+ * config/tc-hppa.h (TC_VALIDATE_FIX_SUB): Define.
+ * config/tc-microblaze.h (TC_VALIDATE_FIX_SUB): Define.
+ * config/tc-alpha.h (TC_VALIDATE_FIX_SUB): Define for ECOFF.
+ * config/tc-ppc.h (TC_VALIDATE_FIX_SUB): Don't define for ELF.
+ Do define for XCOFF.
+
2021-07-14 Clément Chigot <clement.chigot@atos.net>
* config/tc-ppc.c (ppc_change_debug_section): Update to
* testsuite/gas/mips/mips2@cp3m.d: New test.
* testsuite/gas/mips/r3000@cp3m.d: New test.
* testsuite/gas/mips/r3900@cp3m.d: New test.
- * testsuite/gas/mips/mips2@cp3d.d: New test.
+ * testsuite/gas/mips/mips2@cp3d.d: New test.
* testsuite/gas/mips/cp0b.l: New test stderr output.
* testsuite/gas/mips/cp0bl.l: New test stderr output.
* testsuite/gas/mips/cp0c.l: New test stderr output.
#ifdef OBJ_ECOFF
#define tc_frob_file_before_adjust() alpha_frob_file_before_adjust ()
extern void alpha_frob_file_before_adjust (void);
+
+#define TC_VALIDATE_FIX_SUB(FIX, SEG) \
+ ((md_register_arithmetic || (SEG) != reg_section) \
+ && ((FIX)->fx_r_type == BFD_RELOC_GPREL32 \
+ || (FIX)->fx_r_type == BFD_RELOC_GPREL16))
#endif
#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs. */
/* Values passed to md_apply_fix don't include the symbol value. */
#define MD_APPLY_SYM_VALUE(FIX) 0
+/* The PA needs this for PIC code generation. */
+#define TC_VALIDATE_FIX_SUB(FIX, SEG) \
+ (md_register_arithmetic || (SEG) != reg_section)
+
#ifdef OBJ_SOM
/* If a symbol is imported, but never used, then the symbol should
*not* end up in the symbol table. Likewise for absolute symbols
|| (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_64_GOTOFF \
|| (FIX)->fx_r_type == BFD_RELOC_MICROBLAZE_32_GOTOFF)
+#define TC_VALIDATE_FIX_SUB(FIX, SEG) \
+ (md_register_arithmetic || (SEG) != reg_section)
+
#define tc_fix_adjustable(X) tc_microblaze_fix_adjustable(X)
extern int tc_microblaze_fix_adjustable (struct fix *);
|| (FIX)->fx_r_type == BFD_RELOC_PPC64_D34 \
|| (FIX)->fx_r_type == BFD_RELOC_PPC64_D28))
-#define TC_VALIDATE_FIX_SUB(FIX, SEG) 0
-
#endif /* OBJ_ELF */
#define RELOC_EXPANSION_POSSIBLE
/* XCOFF allows undefined differences which will be encoded with
R_NEG relocations. */
#define UNDEFINED_DIFFERENCE_OK
+
+#define TC_VALIDATE_FIX_SUB(FIX, SEG) \
+ (md_register_arithmetic || (SEG) != reg_section)
+
#endif /* OBJ_XCOFF */
/* Various frobbings of labels and their addresses. */
#endif
#ifndef TC_VALIDATE_FIX_SUB
-#ifdef UNDEFINED_DIFFERENCE_OK
-/* The PA needs this for PIC code generation. */
-#define TC_VALIDATE_FIX_SUB(FIX, SEG) \
- (md_register_arithmetic || (SEG) != reg_section)
-#else
-#define TC_VALIDATE_FIX_SUB(FIX, SEG) \
- ((md_register_arithmetic || (SEG) != reg_section) \
- && ((FIX)->fx_r_type == BFD_RELOC_GPREL32 \
- || (FIX)->fx_r_type == BFD_RELOC_GPREL16))
-#endif
+#define TC_VALIDATE_FIX_SUB(FIX, SEG) 0
#endif
#ifndef TC_LINKRELAX_FIXUP