+static int
+elf32_do_open(struct elf32* elf, struct v_file* elf_file)
+{
+ int status = 0;
+ elf->pheaders = NULL;
+ elf->elf_file = elf_file;
+
+ if ((status = elf32_read_ehdr(elf)) < 0) {
+ elf32_close(elf);
+ return status;
+ }
+
+ if ((status = elf32_read_phdr(elf)) < 0) {
+ elf32_close(elf);
+ return status;
+ }
+
+ return 0;
+}
+