From 9cce9fab90e0951c6816d97801e124e392e74dd9 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 10 Jul 2021 15:58:44 +0930 Subject: gas: default TC_VALIDATE_FIX_SUB to 0 gas/write.c provides a fallback TC_VALIDATE_FIX_SUB define that can be a problem for some targets, the problem being that a non-zero definition of TC_VALIDATE_FIX_SUB says that some uses of fx_subsy are OK, in effect that the target will handle fx_subsy in md_apply_fix and/or tc_gen_reloc. A lot of targets don't have the necessary md_apply_fix and tc_gen_reloc support. So a safer default is to disallow fx_subsy by default. I've had a good look over target usage of fx_subsy, and think I've caught all the cases where targets need TC_VALIDATE_FIX_SUB. Possible failures would be limited to alpha, microblaze, ppc and s390 (the targets that define UNDEFINED_DIFFERENCE_OK), or targets that generate fixups with BFD_RELOC_GPREL32/16 and use a syntax explicitly showing a difference expression. * 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. --- gas/write.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'gas/write.c') diff --git a/gas/write.c b/gas/write.c index 7dc78b7..2d67f16 100644 --- a/gas/write.c +++ b/gas/write.c @@ -69,16 +69,7 @@ #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 -- cgit v1.1