os/libc/elf.h

45 lines
779 B
C
Raw Normal View History

2020-08-01 12:09:54 -05:00
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#ifndef ELF_H
#define ELF_H
#define ELF_MAGIC 0x464c457f
#include <stdint.h>
2020-07-26 15:38:29 -05:00
typedef struct {
uint32_t magic;
char type;
char endian;
char version;
char abi;
char padding[8];
uint16_t type2;
uint16_t iset;
uint32_t version2;
uint32_t entry;
uint32_t prog_hdr;
uint32_t section_hdr;
uint32_t flags;
uint16_t header_sz;
uint16_t pheader_ent_sz;
uint16_t pheader_ent_nm;
uint16_t sheader_ent_sz;
uint16_t sheader_ent_nm;
uint16_t sheader_nm_idx;
} __attribute__((packed)) elf_header;
typedef struct {
uint32_t type;
uint32_t offset;
uint32_t vaddr;
uint32_t unused;
uint32_t filesz;
uint32_t memsz;
uint32_t flags;
uint32_t alignment;
} __attribute__((packed)) elf_pheader;
#endif
2020-08-01 12:09:54 -05:00
#endif