diff options
author | Alan Modra <amodra@gmail.com> | 2008-09-19 10:00:40 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2008-09-19 10:00:40 +0000 |
commit | 5db484ff3d77b5241c7cbef02788962fa6aeedd8 (patch) | |
tree | 5c557d1a5d8ca291d9d076e7cec357e574741d52 /gas/write.c | |
parent | e79f59555a009cc9b5ef8233debb948c795a9cca (diff) | |
download | binutils-5db484ff3d77b5241c7cbef02788962fa6aeedd8.zip binutils-5db484ff3d77b5241c7cbef02788962fa6aeedd8.tar.gz binutils-5db484ff3d77b5241c7cbef02788962fa6aeedd8.tar.bz2 |
* write.c (TC_FORCE_RELOCATION_SUB_LOCAL): Heed md_register_arithmetic.
(TC_VALIDATE_FIX_SUB): Likewise.
* config/tc-frv.h (TC_FORCE_RELOCATION_SUB_LOCAL): Likewise.
* config/tc-hppa.h (TC_FORCE_RELOCATION_SUB_LOCAL): Likewise.
* config/tc-mn10300.h (TC_VALIDATE_FIX_SUB): Likewise.
* config/tc-sh.h (TC_VALIDATE_FIX_SUB): Likewise.
(TC_FORCE_RELOCATION_SUB_LOCAL): Likewise.
* config/tc-sh64.h (TC_VALIDATE_FIX_SUB): Likewise.
* config/tc-xtensa.h (TC_VALIDATE_FIX_SUB): Likewise.
* doc/internals.texi (TC_FORCE_RELOCATION_SUB_ABS,
TC_FORCE_RELOCATION_SUB_LOCAL, TC_VALIDATE_FIX_SUB): Show new param.
Diffstat (limited to 'gas/write.c')
-rw-r--r-- | gas/write.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/gas/write.c b/gas/write.c index f03fcf3..1af81a7 100644 --- a/gas/write.c +++ b/gas/write.c @@ -65,20 +65,23 @@ #ifndef TC_FORCE_RELOCATION_SUB_LOCAL #ifdef DIFF_EXPR_OK -#define TC_FORCE_RELOCATION_SUB_LOCAL(FIX) 0 +#define TC_FORCE_RELOCATION_SUB_LOCAL(FIX, SEG) \ + (!md_register_arithmetic && (SEG) == reg_section) #else -#define TC_FORCE_RELOCATION_SUB_LOCAL(FIX) 1 +#define TC_FORCE_RELOCATION_SUB_LOCAL(FIX, SEG) 1 #endif #endif #ifndef TC_VALIDATE_FIX_SUB #ifdef UNDEFINED_DIFFERENCE_OK /* The PA needs this for PIC code generation. */ -#define TC_VALIDATE_FIX_SUB(FIX) 1 +#define TC_VALIDATE_FIX_SUB(FIX, SEG) \ + (md_register_arithmetic || (SEG) != reg_section) #else -#define TC_VALIDATE_FIX_SUB(FIX) \ - ((FIX)->fx_r_type == BFD_RELOC_GPREL32 \ - || (FIX)->fx_r_type == BFD_RELOC_GPREL16) +#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 #endif @@ -936,7 +939,7 @@ fixup_segment (fixS *fixP, segT this_segment) fixP->fx_subsy = NULL; } else if (sub_symbol_segment == this_segment - && !TC_FORCE_RELOCATION_SUB_LOCAL (fixP)) + && !TC_FORCE_RELOCATION_SUB_LOCAL (fixP, add_symbol_segment)) { add_number -= S_GET_VALUE (fixP->fx_subsy); fixP->fx_offset = (add_number + fixP->fx_dot_value @@ -958,7 +961,7 @@ fixup_segment (fixS *fixP, segT this_segment) fixP->fx_subsy = NULL; fixP->fx_pcrel = 1; } - else if (!TC_VALIDATE_FIX_SUB (fixP)) + else if (!TC_VALIDATE_FIX_SUB (fixP, add_symbol_segment)) { if (!md_register_arithmetic && (add_symbol_segment == reg_section |