OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [conts/] [posix/] [mm0/] [include/] [lib/] [elf/] [elf.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * Definitions for Executable Linking Format
3
 * Based on Portable Formats Specification v1.1
4
 *
5
 * Copyright (C) 2008 Bahadir Balban
6
 */
7
 
8
#ifndef __ELF_H__
9
#define __ELF_H__
10
 
11
#include <l4/types.h>
12
 
13
/* ELF identification indices */
14
#define EI_MAG0         0
15
#define EI_MAG1         1
16
#define EI_MAG2         2
17
#define EI_MAG3         3
18
#define EI_CLASS        4
19
#define EI_DATA         5
20
#define EI_VERSION      6
21
#define EI_PAD          7
22
 
23
/* Size of ELF identification field */
24
#define EI_NIDENT       16
25
 
26
/* Values for ELF identification fields */
27
#define ELFMAG0         0x7f
28
#define ELFMAG1         'E'
29
#define ELFMAG2         'L'
30
#define ELFMAG3         'F'
31
 
32
/* Values for the ELF Class field */
33
#define ELFCLASSNONE    0
34
#define ELFCLASS32      1
35
#define ELFCLASS64      2
36
 
37
/* Values for the ELF Data field */
38
#define ELFDATANONE     0
39
#define ELFDATA2LSB     1
40
#define ELFDATA2MSB     2
41
 
42
 
43
struct elf_header {
44
        u8      e_ident[EI_NIDENT];     /* ELF identification */
45
        u16     e_type;                 /* Object file type */
46
        u16     e_machine;              /* Machine architecture */
47
        u32     e_version;              /* Object file version */
48
        u32     e_entry;                /* Virtual entry address */
49
        u32     e_phoff;                /* Program header offset */
50
        u32     e_shoff;                /* Section header offset */
51
        u32     e_flags;                /* Processor specific flags */
52
        u16     e_ehsize;               /* ELF header size */
53
        u16     e_phentsize;            /* Program header entry size */
54
        u16     e_phnum;                /* Number of program headers */
55
        u16     e_shentsize;            /* Section header entry size */
56
        u16     e_shnum;                /* Number of section headers */
57
        u16     e_shstrndx;             /* Shtable index for strings */
58
} __attribute__((__packed__));
59
 
60
 
61
int elf_parse_executable(struct tcb *task, struct vm_file *file,
62
                         struct exec_file_desc *efd);
63
 
64
#endif /* __ELF_H__ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.