+
+ archive = elf_begin (file->fd, ELF_C_READ, NULL);
+ check (elf_kind (archive) == ELF_K_AR, LDPL_FATAL,
+ "Not an archive and offset not 0");
+
+ /* elf_rand expects the offset to point to the ar header, not the
+ object itself. Subtract the size of the ar header (60 bytes).
+ We don't uses sizeof (struct ar_hd) to avoid including ar.h */
+
+ offset = file->offset - 60;
+ check (offset == elf_rand (archive, offset), LDPL_FATAL,
+ "could not seek in archive");
+ elf = elf_begin (file->fd, ELF_C_READ, archive);
+ check (elf != NULL, LDPL_FATAL, "could not find archive member");
+ elf_end (archive);