From 4f33c88a51587681b7be1ae57cfbc43b627c6bc4 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 30 Jul 2012 19:11:16 +0200 Subject: import updated compilers from sources --- sys/src/libmach/elf.h | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) (limited to 'sys/src/libmach/elf.h') 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 */ @@ -18,6 +18,23 @@ typedef struct { ushort shstrndx; /* shdr string index */ } 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 */ @@ -29,6 +46,17 @@ typedef struct { int align; /* memory/file alignment */ } 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_... */ @@ -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, -- cgit v1.2.3