aboutsummaryrefslogtreecommitdiff
path: root/common/elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/elf.c')
-rw-r--r--common/elf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/elf.c b/common/elf.c
new file mode 100644
index 0000000..7531bd1
--- /dev/null
+++ b/common/elf.c
@@ -0,0 +1,9 @@
+#include <apos/elf.h>
+#include <apos/vmem.h>
+
+vm_t bin_entry(vm_t bin)
+{
+ struct elf_header *e = (struct elf_header *)bin;
+ /* TODO: check that address points to a valid ELF executable */
+ return (vm_t)e->e_entry;
+}