if (bfd_bread (& dst, relsz, abfd) != relsz)
return;
- coff_swap_reloc_in (abfd, &dst, &n);
+ bfd_coff_swap_reloc_in (abfd, &dst, &n);
if (bfd_seek (abfd, oldpos, 0) != 0)
return;
if (n.r_vaddr < 0x10000)
if (bfd_bread (& dst, relsz, abfd) != relsz)
return;
- coff_swap_reloc_in (abfd, &dst, &n);
+ bfd_coff_swap_reloc_in (abfd, &dst, &n);
if (bfd_seek (abfd, oldpos, 0) != 0)
return;
section->reloc_count = hdr->s_nreloc = n.r_vaddr - 1;
static bool
coff_slurp_reloc_table (bfd * abfd, sec_ptr asect, asymbol ** symbols)
{
- RELOC *native_relocs;
+ bfd_byte *native_relocs;
arelent *reloc_cache;
arelent *cache_ptr;
unsigned int idx;
if (!coff_slurp_symbol_table (abfd))
return false;
- native_relocs = (RELOC *) buy_and_read (abfd, asect->rel_filepos,
- asect->reloc_count,
- bfd_coff_relsz (abfd));
+ native_relocs = (bfd_byte *) buy_and_read (abfd, asect->rel_filepos,
+ asect->reloc_count,
+ bfd_coff_relsz (abfd));
if (native_relocs == NULL)
return false;
for (idx = 0; idx < asect->reloc_count; idx++)
{
struct internal_reloc dst;
- struct external_reloc *src;
+ void *src;
#ifndef RELOC_PROCESSING
asymbol *ptr;
#endif
cache_ptr = reloc_cache + idx;
- src = native_relocs + idx;
+ src = native_relocs + idx * (size_t) bfd_coff_relsz (abfd);
dst.r_offset = 0;
- coff_swap_reloc_in (abfd, src, &dst);
+ bfd_coff_swap_reloc_in (abfd, src, &dst);
#ifdef RELOC_PROCESSING
RELOC_PROCESSING (cache_ptr, &dst, symbols, abfd, asect);
{
coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in,
coff_SWAP_aux_out, coff_SWAP_sym_out,
- coff_SWAP_lineno_out, coff_SWAP_reloc_out,
+ coff_SWAP_lineno_out, coff_swap_reloc_v0_out,
coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out,
coff_SWAP_scnhdr_out,
FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN,
#endif
32768,
coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in,
- coff_SWAP_reloc_in, ticoff0_bad_format_hook, coff_set_arch_mach_hook,
+ coff_swap_reloc_v0_in, ticoff0_bad_format_hook, coff_set_arch_mach_hook,
coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook,
coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate,
return bfd_coff_relsz (abfd);
}
+#ifdef TICOFF
+static void
+coff_swap_reloc_v0_in (bfd *abfd, void *src, void *dst)
+{
+ struct external_reloc_v0 *reloc_src = (struct external_reloc_v0 *) src;
+ struct internal_reloc *reloc_dst = (struct internal_reloc *) dst;
+
+ reloc_dst->r_vaddr = GET_RELOC_VADDR (abfd, reloc_src->r_vaddr);
+ reloc_dst->r_symndx = H_GET_16 (abfd, reloc_src->r_symndx);
+ reloc_dst->r_type = H_GET_16 (abfd, reloc_src->r_type);
+}
+
+static unsigned int
+coff_swap_reloc_v0_out (bfd *abfd, void *src, void *dst)
+{
+ struct internal_reloc *reloc_src = (struct internal_reloc *) src;
+ struct external_reloc_v0 *reloc_dst = (struct external_reloc_v0 *) dst;
+
+ PUT_RELOC_VADDR (abfd, reloc_src->r_vaddr, reloc_dst->r_vaddr);
+ H_PUT_16 (abfd, reloc_src->r_symndx, reloc_dst->r_symndx);
+ H_PUT_16 (abfd, reloc_src->r_type, reloc_dst->r_type);
+ SWAP_OUT_RELOC_EXTRA (abfd, reloc_src, reloc_dst);
+
+ return bfd_coff_relsz (abfd);
+}
+#endif
+
#endif /* NO_COFF_RELOCS */
static void