return status;
}
+ if (!elf_check_arch(elf)) {
+ return EINVAL;
+ }
+
if ((status = elf_read_phdr(elf)) < 0) {
elf_close(elf);
return status;
return 0;
}
-defualt int
+_default int
elf_open(struct elf* elf, const char* path)
{
struct v_dnode* elfdn;
return elf_do_open(elf, elffile);
}
-defualt int
+_default int
elf_openat(struct elf* elf, void* elf_vfile)
{
// so the ref count kept in sync
return elf_do_open(elf, elf_vfile);
}
-defualt int
+_default int
elf_close(struct elf* elf)
{
if (elf->pheaders) {
return 0;
}
-defualt int
+_default int
elf_static_linked(const struct elf* elf)
{
for (size_t i = 0; i < elf->eheader.e_phnum; i++) {
return 1;
}
-defualt size_t
+_default size_t
elf_loadable_memsz(const struct elf* elf)
{
// XXX: Hmmmm, I am not sure if we need this. This is designed to be handy
return sz;
}
-defualt int
+_default int
elf_find_loader(const struct elf* elf, char* path_out, size_t len)
{
int retval = NO_LOADER;
return retval;
}
-defualt int
+_default int
elf_read_ehdr(struct elf* elf)
{
struct v_file* elfile = (struct v_file*)elf->elf_file;
return elf_read(elfile, (void*)&elf->eheader, 0, SIZE_EHDR);
}
-defualt int
+_default int
elf_read_phdr(struct elf* elf)
{
int status = 0;
return entries;
}
-defualt int
+_default int
elf_check_exec(const struct elf* elf, int type)
{
const struct elf_ehdr* ehdr = &elf->eheader;
return (ehdr->e_entry) && ehdr->e_type == type;
}
-defualt int
+_default int
elf_check_arch(const struct elf* elf)
{
const struct elf_ehdr* ehdr = &elf->eheader;