From 8f36cd18af6756dd6ab50da33d2c7574fc711527 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 22 Aug 2000 04:52:40 +0000 Subject: [PATCH] * write.c (TC_FIX_ADJUSTABLE): Define to 1, if not defined. (fixup_segment) Use it instead of TC_DONT_FIX_NON_ADJUSTABLE. * config/tc-i386.h (TC_DONT_FIX_NON_ADJUSTABLE): Remove. (TC_FIX_ADJUSTABLE): Define. * config/tc-arm.h (TC_DONT_FIX_NON_ADJUSTABLE): Remove. (TC_FIX_ADJUSTABLE): Define. * config/tc-i960.h, config/tc-m68k.h, config/tc-v850.h: Likewise. --- gas/ChangeLog | 11 +++++++++++ gas/config/tc-arm.h | 8 ++++---- gas/config/tc-i386.h | 10 ++++++---- gas/config/tc-i960.h | 7 +++---- gas/config/tc-m68k.h | 9 ++++++--- gas/config/tc-v850.h | 9 ++++++--- gas/write.c | 19 +++++++++---------- 7 files changed, 45 insertions(+), 28 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index d6117d66b83..ae9d16f2dbe 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,14 @@ +2000-08-22 Alexandre Oliva + + * write.c (TC_FIX_ADJUSTABLE): Define to 1, if not defined. + (fixup_segment) Use it instead of TC_DONT_FIX_NON_ADJUSTABLE. + * config/tc-i386.h (TC_DONT_FIX_NON_ADJUSTABLE): Remove. + (TC_FIX_ADJUSTABLE): Define. + * config/tc-arm.h (TC_DONT_FIX_NON_ADJUSTABLE): Remove. + (TC_FIX_ADJUSTABLE): Define. + * config/tc-i960.h, config/tc-m68k.h, config/tc-v850.h: + Likewise. + 2000-08-22 Eric Christopher * config/tc-mn10300.c: (md_apply_fix): New function. diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h index 28d8bc4ed26..76cf767bf64 100644 --- a/gas/config/tc-arm.h +++ b/gas/config/tc-arm.h @@ -116,14 +116,14 @@ #define TC_FIX_TYPE PTR #define TC_INIT_FIX_DATA(FIXP) ((FIXP)->tc_fix_data = NULL) -/* This arranges for gas/write.c to not apply a relocation if - obj_fix_adjustable() says it is not adjustable. */ -#define TC_DONT_FIX_NON_ADJUSTABLE 1 - #ifdef OBJ_ELF #include "write.h" /* For definition of fixS */ #define obj_fix_adjustable(fixP) arm_fix_adjustable (fixP) boolean arm_fix_adjustable PARAMS ((fixS *)); + +/* This arranges for gas/write.c to not apply a relocation if + obj_fix_adjustable() says it is not adjustable. */ +#define TC_FIX_ADJUSTABLE(fixP) obj_fix_adjustable (fixP) #else #define obj_fix_adjustable(fixP) 0 #endif diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h index e4a5731857f..9c4609b3bec 100644 --- a/gas/config/tc-i386.h +++ b/gas/config/tc-i386.h @@ -38,13 +38,15 @@ struct fix; type. The idea is that if the original type is already some kind of PIC relocation, we leave it alone, otherwise we give it the desired type */ -/* This arranges for gas/write.c to not apply a relocation if - tc_fix_adjustable() says it is not adjustable. */ -#define TC_DONT_FIX_NON_ADJUSTABLE 1 - #define tc_fix_adjustable(X) tc_i386_fix_adjustable(X) extern int tc_i386_fix_adjustable PARAMS ((struct fix *)); +#if defined (OBJ_ELF) || defined (OBJ_COFF) || defined (TE_PE) +/* This arranges for gas/write.c to not apply a relocation if + tc_fix_adjustable() says it is not adjustable. */ +#define TC_FIX_ADJUSTABLE(fixP) tc_fix_adjustable (fixP) +#endif + /* This is the relocation type for direct references to GLOBAL_OFFSET_TABLE. * It comes up in complicated expressions such as * _GLOBAL_OFFSET_TABLE_+[.-.L284], which cannot be expressed normally with diff --git a/gas/config/tc-i960.h b/gas/config/tc-i960.h index dca9d4a61a7..4623532f228 100644 --- a/gas/config/tc-i960.h +++ b/gas/config/tc-i960.h @@ -153,12 +153,11 @@ extern int i960_validate_fix PARAMS ((struct fix *, segT, symbolS **)); && ! S_IS_COMMON ((FIX)->fx_addsy))) #endif -/* This arranges for gas/write.c to not apply a relocation if - tc_fix_adjustable() says it is not adjustable. */ -#define TC_DONT_FIX_NON_ADJUSTABLE 1 - #ifndef OBJ_ELF #define tc_fix_adjustable(FIXP) ((FIXP)->fx_bsr == 0) +/* This arranges for gas/write.c to not apply a relocation if + tc_fix_adjustable() says it is not adjustable. */ +#define TC_FIX_ADJUSTABLE(fixP) tc_fix_adjustable (fixP) #else #define tc_fix_adjustable(FIXP) \ ((FIXP)->fx_bsr == 0 \ diff --git a/gas/config/tc-m68k.h b/gas/config/tc-m68k.h index 1941e300837..10ac44ebaed 100644 --- a/gas/config/tc-m68k.h +++ b/gas/config/tc-m68k.h @@ -173,12 +173,15 @@ while (0) && S_IS_DEFINED ((FIX)->fx_addsy) \ && ! S_IS_COMMON ((FIX)->fx_addsy))) +#define tc_fix_adjustable(X) tc_m68k_fix_adjustable(X) +extern int tc_m68k_fix_adjustable PARAMS ((struct fix *)); + +#ifdef OBJ_ELF /* This arranges for gas/write.c to not apply a relocation if tc_fix_adjustable() says it is not adjustable. */ -#define TC_DONT_FIX_NON_ADJUSTABLE 1 +#define TC_FIX_ADJUSTABLE(fixP) tc_fix_adjustable (fixP) +#endif -#define tc_fix_adjustable(X) tc_m68k_fix_adjustable(X) -extern int tc_m68k_fix_adjustable PARAMS ((struct fix *)); #define elf_tc_final_processing m68k_elf_final_processing extern void m68k_elf_final_processing PARAMS ((void)); #endif diff --git a/gas/config/tc-v850.h b/gas/config/tc-v850.h index 59fa5074211..97b903e890b 100644 --- a/gas/config/tc-v850.h +++ b/gas/config/tc-v850.h @@ -37,12 +37,15 @@ #define MD_APPLY_FIX3 #define md_operand(x) +#define obj_fix_adjustable(fixP) v850_fix_adjustable(fixP) +#define TC_FORCE_RELOCATION(fixp) v850_force_relocation(fixp) + +#ifdef OBJ_ELF /* This arranges for gas/write.c to not apply a relocation if obj_fix_adjustable() says it is not adjustable. */ -#define TC_DONT_FIX_NON_ADJUSTABLE 1 +#define TC_FIX_ADJUSTABLE(fixP) obj_fix_adjustable (fixP) +#endif -#define obj_fix_adjustable(fixP) v850_fix_adjustable(fixP) -#define TC_FORCE_RELOCATION(fixp) v850_force_relocation(fixp) extern int v850_force_relocation PARAMS ((struct fix *)); /* Permit temporary numeric labels. */ diff --git a/gas/write.c b/gas/write.c index 67d39ab1b95..978fcc29ffe 100644 --- a/gas/write.c +++ b/gas/write.c @@ -48,10 +48,18 @@ #define TC_FORCE_RELOCATION_SECTION(FIXP,SEG) TC_FORCE_RELOCATION(FIXP) #endif +#ifndef TC_FIX_ADJUSTABLE +#define TC_FIX_ADJUSTABLE(fix) 1 +#endif + #ifndef TC_LINKRELAX_FIXUP #define TC_LINKRELAX_FIXUP(SEG) 1 #endif +#ifndef TC_FIX_ADJUSTABLE +#define TC_FIX_ADJUSTABLE(fix) 1 +#endif + #ifndef MD_PCREL_FROM_SECTION #define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from(FIXP) #endif @@ -2710,16 +2718,7 @@ fixup_segment (fixP, this_segment_type) else { seg_reloc_count++; -#ifdef TC_DONT_FIX_NON_ADJUSTABLE - if (1 -#ifdef obj_fix_adjustable - && obj_fix_adjustable (fixP) -#endif -#ifdef tc_fix_adjustable - && tc_fix_adjustable (fixP) -#endif - ) -#endif + if (TC_FIX_ADJUSTABLE (fixP)) add_number += S_GET_VALUE (add_symbolP); } } -- 2.30.2