aboutsummaryrefslogtreecommitdiff
path: root/include/elf.h
diff options
context:
space:
mode:
authorNathan Whitehorn <nwhitehorn@freebsd.org>2015-01-27 17:00:38 -0800
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-02-04 15:33:11 +1100
commitcd19c10e69a550ef7a56aab3954bd22110ce4f12 (patch)
treedbacc35f3b4abe80db85de2484a6fba289de92ff /include/elf.h
parent0c89bbc3a64c0e1fc6a26651bf7408b77ddc1dd9 (diff)
downloadskiboot-cd19c10e69a550ef7a56aab3954bd22110ce4f12.zip
skiboot-cd19c10e69a550ef7a56aab3954bd22110ce4f12.tar.gz
skiboot-cd19c10e69a550ef7a56aab3954bd22110ce4f12.tar.bz2
Allow ELF executables with function descriptor entrypoint to be skiboot payloads
Big-endian ELF64 ELF executables normally (the Linux kernel is an exception) have their entry point refer to a function descriptor instead of the first instruction. Distinguish between the Linux case and the function descriptor case, which is used for the FreeBSD kernel, by checking whether the entry point points into an executable section or not. This allows use of the FreeBSD kernel as a skiboot payload. Signed-off-by: Nathan Whitehorn <nwhitehorn@freebsd.org> [stewart@linux.vnet.ibm.com: reverse test polarity, change continue to break] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include/elf.h')
-rw-r--r--include/elf.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/elf.h b/include/elf.h
index 0a52f3e..7d12e5a 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -76,6 +76,23 @@ struct elf64_phdr {
uint64_t p_align;
};
+/* 64-bit ELF section header */
+struct elf64_shdr {
+ uint32_t sh_name;
+ uint32_t sh_type;
+ uint64_t sh_flags;
+#define ELF_SFLAGS_X 0x4
+#define ELF_SFLAGS_A 0x2
+#define ELF_SFLAGS_W 0x1
+ uint64_t sh_addr;
+ uint64_t sh_offset;
+ uint64_t sh_size;
+ uint32_t sh_link;
+ uint32_t sh_info;
+ uint64_t sh_addralign;
+ int64_t sh_entsize;
+};
+
/* Some relocation related stuff used in relocate.c */
struct elf64_dyn {
int64_t d_tag;