diff options
author | Ian Lance Taylor <ian@airs.com> | 1995-09-18 21:11:34 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1995-09-18 21:11:34 +0000 |
commit | 3b06beb75730bf894e2a9621ab48023806b05c2e (patch) | |
tree | af0954a8476ace043de17eca0ee41f25d3d0e6c4 /gas | |
parent | 85f341221b37b1b472419cc79f125a3fdd7643cc (diff) | |
download | gdb-3b06beb75730bf894e2a9621ab48023806b05c2e.zip gdb-3b06beb75730bf894e2a9621ab48023806b05c2e.tar.gz gdb-3b06beb75730bf894e2a9621ab48023806b05c2e.tar.bz2 |
* 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.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 10 | ||||
-rw-r--r-- | gas/config/tc-m68k.c | 13 |
2 files changed, 23 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 2d5da34..fd3cde6 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,15 @@ Mon Sep 18 15:22:28 1995 Ian Lance Taylor <ian@cygnus.com> + * 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 <arnej@pvv.unit.no> diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index d68ac46..0e8fa25 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", |