- amt = symtab_hdr->sh_info;
- amt *= sizeof (Elf64_External_Sym);
-
- external_syms = (Elf64_External_Sym *) bfd_malloc (amt);
- if (external_syms == NULL && symtab_hdr->sh_info > 0)
- goto error_return;
-
- if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0
- || (bfd_bread ((PTR) external_syms, amt, input_bfd) != amt))
- goto error_return;
- }
-
- if (symtab_hdr->sh_info != 0 && shndx_hdr->sh_size != 0)
- {
- amt = symtab_hdr->sh_info;
- amt *= sizeof (Elf_External_Sym_Shndx);
-
- shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt);
- if (shndx_buf == NULL)
- goto error_return;
-
- if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0
- || bfd_bread ((PTR) shndx_buf, amt, input_bfd) != amt)
+ isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
+ if (isymbuf == NULL)
+ isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr,
+ symtab_hdr->sh_info, 0,
+ NULL, NULL, NULL);
+ if (isymbuf == NULL)