Elf_Internal_Rela *irel;
Elf_Internal_Rela *irelend;
struct elf_link_hash_entry *sym_hash;
- Elf_Internal_Shdr *shndx_hdr;
Elf_External_Sym_Shndx *shndx;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
/* Adjust all the relocs. */
irel = elf_section_data (sec)->relocs;
irelend = irel + sec->reloc_count;
- shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr;
- shndx = (Elf_External_Sym_Shndx *) shndx_hdr->contents;
+ if (elf_symtab_shndx_list (abfd))
+ {
+ Elf_Internal_Shdr *shndx_hdr;
+
+ shndx_hdr = & elf_symtab_shndx_list (abfd)->hdr;
+ shndx = (Elf_External_Sym_Shndx *) shndx_hdr->contents;
+ }
+ else
+ {
+ shndx = NULL;
+ }
for (; irel < irelend; irel++)
{