* config/obj-coff.c (fixup_segment): Subtract the section address

from a PC relative reloc if TC_M68K.
This commit is contained in:
Ian Lance Taylor 1996-10-04 22:38:44 +00:00
parent 99777c0bfb
commit eb0dafdc04
2 changed files with 23 additions and 11 deletions

View file

@ -1,3 +1,8 @@
Fri Oct 4 18:37:32 1996 Ian Lance Taylor <ian@cygnus.com>
* 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 <ian@cygnus.com>
* config/tc-sparc.c (md_pseudo_table): Make .uahalf, .uaword, and

View file

@ -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 */