diff options
Diffstat (limited to 'gas/config/obj-coff.c')
-rw-r--r-- | gas/config/obj-coff.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index 62ed1b8..eea84bc 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -3971,15 +3971,9 @@ fixup_segment (segP, this_segment_type) add_number += S_GET_VALUE (add_symbolP); add_number -= md_pcrel_from (fixP); -#if defined (TC_I386) || defined (TE_LYNX) || defined (TC_I960) +#if defined (TC_I386) || defined (TE_LYNX) /* On the 386 we must adjust by the segment vaddr as - well. Ian Taylor. I changed the i960 to work this - way as well. This is compatible with the current GNU - linker behaviour. I do not know what other i960 COFF - assemblers do. This is not a common case: normally, - only assembler code will contain a PC relative reloc, - and only branches which do not originate in the .text - section will have a non-zero address. */ + well. Ian Taylor. */ add_number -= segP->scnhdr.s_vaddr; #endif pcrel = 0; /* Lie. Don't want further pcrel processing. */ @@ -4061,10 +4055,23 @@ fixup_segment (segP, this_segment_type) { fixP->fx_addsy = &abs_symbol; } /* if there's an add_symbol */ -#if defined (TC_I386) || defined (TE_LYNX) || defined (TC_I960) +#if defined (TC_I386) || defined (TE_LYNX) || defined (TC_I960) || defined (TC_M68K) /* On the 386 we must adjust by the segment vaddr as well. - Ian Taylor. As noted above, I made the i960 work this - way as well. */ + Ian Taylor. + + I changed the i960 to work this way as well. This is + compatible with the current GNU linker behaviour. I do + not know what other i960 COFF assemblers do. This is not + a common case: normally, only assembler code will contain + a PC relative reloc, and only branches which do not + originate in the .text section will have a non-zero + address. + + I changed the m68k to work this way as well. This will + break existing PC relative relocs from sections which do + not start at address 0, but it will make ld -r work. + Ian Taylor, 4 Oct 96. */ + add_number -= segP->scnhdr.s_vaddr; #endif } /* if pcrel */ |