From: Ian Lance Taylor Date: Mon, 18 Sep 1995 21:11:34 +0000 (+0000) Subject: * write.c (fixup_segment): Handle ABS-sym in -sym case rather than X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3b06beb75730bf894e2a9621ab48023806b05c2e;p=binutils-gdb.git * write.c (fixup_segment): Handle ABS-sym in -sym case rather than sym-sym case. * config/obj-coff.c (fixup_segment): Likewise. Permit negative symbols if TC_M68K. * config/tc-m68k.c (tc_coff_fix2rtype): If fx_tcbit is set, return R_RELLONG_NEG. (tc_gen_reloc): If fx_tcbit is set, abort. (md_apply_fix_2): For a negative reloc, move fx_subsy to fx_addsy, and set fx_tcbit. Permits generating negative relocs for m68k COFF. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 2d5da34f7ed..fd3cde624f3 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,15 @@ Mon Sep 18 15:22:28 1995 Ian Lance Taylor + * write.c (fixup_segment): Handle ABS-sym in -sym case rather than + sym-sym case. + * config/obj-coff.c (fixup_segment): Likewise. Permit negative + symbols if TC_M68K. + * config/tc-m68k.c (tc_coff_fix2rtype): If fx_tcbit is set, return + R_RELLONG_NEG. + (tc_gen_reloc): If fx_tcbit is set, abort. + (md_apply_fix_2): For a negative reloc, move fx_subsy to fx_addsy, + and set fx_tcbit. + * config/tc-m68k.c (s_reg): Ignore comment field in MRI mode. Mon Sep 18 14:44:04 1995 Arne H. Juul diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index d68ac46e449..0e8fa25568b 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -562,6 +562,8 @@ short tc_coff_fix2rtype (fixP) fixS *fixP; { + if (fixP->fx_tcbit && fixP->fx_size == 4) + return R_RELLONG_NEG; #ifdef NO_PCREL_RELOCS know (fixP->fx_pcrel == 0); return (fixP->fx_size == 1 ? R_RELBYTE @@ -590,6 +592,9 @@ tc_gen_reloc (section, fixp) arelent *reloc; bfd_reloc_code_real_type code; + if (fixP->fx_tcbit) + abort (); + #define F(SZ,PCREL) (((SZ) << 1) + (PCREL)) switch (F (fixp->fx_size, fixp->fx_pcrel)) { @@ -3354,6 +3359,14 @@ md_apply_fix_2 (fixP, val) BAD_CASE (fixP->fx_size); } + /* Fix up a negative reloc. */ + if (fixP->fx_addsy == NULL && fixP->fx_subsy != NULL) + { + fixP->fx_addsy = fixP->fx_subsy; + fixP->fx_subsy = NULL; + fixP->fx_tcbit = 1; + } + /* For non-pc-relative values, it's conceivable we might get something like "0xff" for a byte field. So extend the upper part of the range to accept such numbers. We arbitrarily disallow "-0xff" or "0xff+0xff",