if (sec->orelocation == NULL)
return;
- rela_hdr = &elf_section_data (sec)->rel_hdr;
+ rela_hdr = elf_section_data (sec)->rela.hdr;
+ if (rela_hdr == NULL)
+ rela_hdr = elf_section_data (sec)->rel.hdr;
rela_hdr->sh_size = rela_hdr->sh_entsize * sec->reloc_count;
rela_hdr->contents = (unsigned char *) bfd_alloc (abfd, rela_hdr->sh_size);
|| asect->reloc_count == 0)
return TRUE;
- rel_hdr = &d->rel_hdr;
- reloc_count = NUM_SHDR_ENTRIES (rel_hdr);
- rel_hdr2 = d->rel_hdr2;
- reloc_count2 = (rel_hdr2 ? NUM_SHDR_ENTRIES (rel_hdr2) : 0);
+ rel_hdr = d->rel.hdr;
+ reloc_count = rel_hdr ? NUM_SHDR_ENTRIES (rel_hdr) : 0;
+ rel_hdr2 = d->rela.hdr;
+ reloc_count2 = rel_hdr2 ? NUM_SHDR_ENTRIES (rel_hdr2) : 0;
BFD_ASSERT (asect->reloc_count == reloc_count + reloc_count2);
- BFD_ASSERT (asect->rel_filepos == rel_hdr->sh_offset
+ BFD_ASSERT ((rel_hdr && asect->rel_filepos == rel_hdr->sh_offset)
|| (rel_hdr2 && asect->rel_filepos == rel_hdr2->sh_offset));
}
if (relents == NULL)
return FALSE;
- if (!elf_slurp_reloc_table_from_section (abfd, asect,
- rel_hdr, reloc_count,
- relents,
- symbols, dynamic))
+ if (rel_hdr
+ && !elf_slurp_reloc_table_from_section (abfd, asect,
+ rel_hdr, reloc_count,
+ relents,
+ symbols, dynamic))
return FALSE;
if (rel_hdr2