summaryrefslogtreecommitdiff
path: root/sys/src/libmach/elf.h
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-07-30 19:11:16 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-07-30 19:11:16 +0200
commit4f33c88a51587681b7be1ae57cfbc43b627c6bc4 (patch)
tree25560404dc80007e5dc268811242c9071f6a1017 /sys/src/libmach/elf.h
parentfcc5e75d07e5bc6cb3ddac6d9a437e7ec62d0d95 (diff)
import updated compilers from sources
Diffstat (limited to 'sys/src/libmach/elf.h')
-rw-r--r--sys/src/libmach/elf.h47
1 files changed, 45 insertions, 2 deletions
diff --git a/sys/src/libmach/elf.h b/sys/src/libmach/elf.h
index 5d755b7a6..94fa7331c 100644
--- a/sys/src/libmach/elf.h
+++ b/sys/src/libmach/elf.h
@@ -1,5 +1,5 @@
/*
- * Definitions needed for accessing Irix ELF headers
+ * Definitions needed for accessing ELF headers
*/
typedef struct {
uchar ident[16]; /* ident bytes */
@@ -19,6 +19,23 @@ typedef struct {
} Ehdr;
typedef struct {
+ u8int ident[16]; /* ident bytes */
+ u16int type; /* file type */
+ u16int machine; /* target machine */
+ u32int version; /* file version */
+ u64int elfentry; /* start address */
+ u64int phoff; /* phdr file offset */
+ u64int shoff; /* shdr file offset */
+ u32int flags; /* file flags */
+ u16int ehsize; /* sizeof ehdr */
+ u16int phentsize; /* sizeof phdr */
+ u16int phnum; /* number phdrs */
+ u16int shentsize; /* sizeof shdr */
+ u16int shnum; /* number shdrs */
+ u16int shstrndx; /* shdr string index */
+} E64hdr;
+
+typedef struct {
int type; /* entry type */
ulong offset; /* file offset */
ulong vaddr; /* virtual address */
@@ -30,6 +47,17 @@ typedef struct {
} Phdr;
typedef struct {
+ u32int type; /* entry type */
+ u32int flags; /* entry flags */
+ u64int offset; /* file offset */
+ u64int vaddr; /* virtual address */
+ u64int paddr; /* physical address */
+ u64int filesz; /* file size */
+ u64int memsz; /* memory size */
+ u64int align; /* memory/file alignment */
+} P64hdr;
+
+typedef struct {
ulong name; /* section name */
ulong type; /* SHT_... */
ulong flags; /* SHF_... */
@@ -42,6 +70,19 @@ typedef struct {
ulong entsize; /* entry size if table */
} Shdr;
+typedef struct {
+ u32int name; /* section name */
+ u32int type; /* SHT_... */
+ u64int flags; /* SHF_... */
+ u64int addr; /* virtual address */
+ u64int offset; /* file offset */
+ u64int size; /* section size */
+ u32int link; /* misc info */
+ u32int info; /* misc info */
+ u64int addralign; /* memory alignment */
+ u64int entsize; /* entry size if table */
+} S64hdr;
+
enum {
/* Ehdr codes */
MAG0 = 0, /* ident[] indexes */
@@ -80,8 +121,10 @@ enum {
S370 = 9, /* Amdhal */
SPARC64 = 18, /* Sun SPARC v9 */
POWER = 20, /* PowerPC */
- ARM = 40, /* ARM */
+ POWER64 = 21, /* PowerPC64 */
+ ARM = 40, /* ARM */
AMD64 = 62, /* Amd64 */
+ ARM64 = 183, /* ARM64 */
NO_VERSION = 0, /* version, ident[VERSION] */
CURRENT = 1,