summaryrefslogtreecommitdiff
path: root/lib/elf.h
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2021-12-17 16:06:06 +0000
committerAda Christine <adachristine18@gmail.com>2021-12-17 16:06:06 +0000
commitd5f485a4f6801f58cbb2bc9d8e80c955c79ff044 (patch)
treee49757ff0b076fe9f0088de92e5691d362e769a0 /lib/elf.h
parentec1233b4fcd61a8d1eccbf030cede36e9848e06c (diff)
R_AMD64_RELATIVE relocations implemented for EFI shim
Diffstat (limited to 'lib/elf.h')
-rw-r--r--lib/elf.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/elf.h b/lib/elf.h
new file mode 100644
index 0000000..3edb0a1
--- /dev/null
+++ b/lib/elf.h
@@ -0,0 +1,17 @@
+#pragma once
+
+#include <elf/elf64.h>
+
+#include <stdbool.h>
+#include <stddef.h>
+
+#ifdef __x86_64__
+# define elf_validate elf64_validate
+# define elf_size elf64_size
+# define elf_reloc elf64_reloc
+#endif
+
+bool elf64_validate(Elf64_Ehdr *ehdr, unsigned type, unsigned machine);
+size_t elf64_size(Elf64_Ehdr *ehdr, Elf64_Phdr *phdr);
+void elf64_reloc(Elf64_Ehdr *ehdr);
+