ld-tool portability fix: MacOS build experience
[lunaix-os.git] / lunaix-os / includes / lunaix / exebi / elf32.h
index d9f4f58308201141612decf0586bc929d9ad4225..1cda2c73778f8cc8b6ea9ed6da65463efc6b72a7 100644 (file)
@@ -11,6 +11,7 @@ typedef unsigned int elf32_wrd_t;
 
 #define ET_NONE 0
 #define ET_EXEC 2
+#define ET_DYN 3
 
 #define PT_LOAD 1
 #define PT_INTERP 3
@@ -69,7 +70,7 @@ struct elf32_phdr
 
 struct elf32
 {
-    void* elf_file;
+    const void* elf_file;
     struct elf32_ehdr eheader;
     struct elf32_phdr* pheaders;
 };
@@ -77,6 +78,12 @@ struct elf32
 #define declare_elf32(elf, elf_vfile)                                          \
     struct elf32 elf = { .elf_file = elf_vfile, .pheaders = (void*)0 }
 
+int
+elf32_check_exec(const struct elf32* elf, int type);
+
+int
+elf32_check_arch(const struct elf32* elf);
+
 int
 elf32_open(struct elf32* elf, const char* path);