+struct elf32
+{
+ void* elf_file;
+ struct elf32_ehdr eheader;
+ struct elf32_phdr* pheaders;
+};
+
+#define declare_elf32(elf, elf_vfile) \
+ struct elf32 elf = { .elf_file = elf_vfile, .pheaders = (void*)0 }
+
+int
+elf32_open(struct elf32* elf, const char* path);
+
+int
+elf32_openat(struct elf32* elf, void* elf_vfile);
+
+int
+elf32_static_linked(const struct elf32* elf);
+
+int
+elf32_close(struct elf32* elf);
+
+/**
+ * @brief Try to find the PT_INTERP section. If found, copy it's content to
+ * path_out
+ *
+ * @param elf Opened elf32 descriptor
+ * @param path_out
+ * @param len size of path_out buffer
+ * @return int
+ */
+int
+elf32_find_loader(const struct elf32* elf, char* path_out, size_t len);
+
+int
+elf32_read_ehdr(struct elf32* elf);
+
+int
+elf32_read_phdr(struct elf32* elf);
+
+/**
+ * @brief Estimate how much memeory will be acquired if we load all loadable
+ * sections.、
+ *
+ * @param elf
+ * @return size_t
+ */
+size_t
+elf32_loadable_memsz(const struct elf32* elf);
+
+int
+elf32_load(struct load_context* ldctx, const struct elf32* elf);
+