From eb0dafdc04492134edaf183539a1ddbf65b66988 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 4 Oct 1996 22:38:44 +0000 Subject: [PATCH] * config/obj-coff.c (fixup_segment): Subtract the section address from a PC relative reloc if TC_M68K. --- gas/ChangeLog | 5 +++++ gas/config/obj-coff.c | 29 ++++++++++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 95a5bcd5451..ba8bebd4b94 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +Fri Oct 4 18:37:32 1996 Ian Lance Taylor + + * config/obj-coff.c (fixup_segment): Subtract the section address + from a PC relative reloc if TC_M68K. + Thu Oct 3 15:15:30 1996 Ian Lance Taylor * config/tc-sparc.c (md_pseudo_table): Make .uahalf, .uaword, and diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index 62ed1b8d223..eea84bce1fd 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 */ -- 2.30.2