Fri Apr 15 12:22:07 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+ * coff-a29k.c (reloc_processing): Always set the address of a
+ R_IHCONST reloc to that of the immediately preceding R_IHIHALF.
+ gas does this anyhow, but some other assemblers seem to leave
+ garbage in the R_IHCONST address field.
+
* bfd/archive.c: Consistently use ARFMAG; from
schwab@issan.informatik.uni-dortmund.de (Andreas Schwab).
(_bfd_write_archive_contents): Use ARFMAG rather than '`' and
bfd *abfd;
asection *section;
{
+ static bfd_vma ihihalf_vaddr = (bfd_vma) -1;
+
relent->address = reloc->r_vaddr;
relent->howto = howto_table + reloc->r_type;
if (reloc->r_type == R_IHCONST)
{
+ /* The address of an R_IHCONST should always be the address of
+ the immediately preceding R_IHIHALF. relocs generated by gas
+ are correct, but relocs generated by High C are different (I
+ can't figure out what the address means for High C). We can
+ handle both gas and High C by ignoring the address here, and
+ simply reusing the address saved for R_IHIHALF. */
+ if (ihihalf_vaddr == (bfd_vma) -1)
+ abort ();
+ relent->address = ihihalf_vaddr;
+ ihihalf_vaddr = (bfd_vma) -1;
relent->addend = reloc->r_symndx;
relent->sym_ptr_ptr= bfd_abs_section.symbol_ptr_ptr;
}
relent->addend = 0;
}
relent->address-= section->vma;
+ if (reloc->r_type == R_IHIHALF)
+ ihihalf_vaddr = relent->address;
+ else if (ihihalf_vaddr != (bfd_vma) -1)
+ abort ();
}
}