diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-04-15 22:22:07 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-04-15 22:22:07 +0000 |
commit | 09ed36667183ce5473548300c6f4ec3d705e6cb5 (patch) | |
tree | 3f61fe525991c319d44edaf4260e3a5255d3e864 /bfd/coff-a29k.c | |
parent | fad466eb6de0629edc89081998337fd13566e989 (diff) | |
download | gdb-09ed36667183ce5473548300c6f4ec3d705e6cb5.zip gdb-09ed36667183ce5473548300c6f4ec3d705e6cb5.tar.gz gdb-09ed36667183ce5473548300c6f4ec3d705e6cb5.tar.bz2 |
* 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.
Diffstat (limited to 'bfd/coff-a29k.c')
-rw-r--r-- | bfd/coff-a29k.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bfd/coff-a29k.c b/bfd/coff-a29k.c index 500057c..42127ec 100644 --- a/bfd/coff-a29k.c +++ b/bfd/coff-a29k.c @@ -257,10 +257,22 @@ reloc_processing (relent,reloc, symbols, abfd, section) 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; } @@ -283,6 +295,10 @@ reloc_processing (relent,reloc, symbols, abfd, section) 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 (); } } |