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

Subversion Repositories eco32

[/] [eco32/] [tags/] [eco32-0.22/] [disk/] [tools/] [fs-NetBSD/] [loader/] [elf.h] - Blame information for rev 52

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 17 hellwig
/*
2
 * elf.h -- structure of ELF files
3
 */
4
 
5
 
6
#ifndef _ELF_H_
7
#define _ELF_H_
8
 
9
 
10
typedef unsigned int Elf32_Addr;
11
typedef unsigned short Elf32_Half;
12
typedef unsigned int Elf32_Off;
13
typedef signed int Elf32_Sword;
14
typedef unsigned int Elf32_Word;
15
 
16
 
17
#define EI_MAG0         0
18
#define EI_MAG1         1
19
#define EI_MAG2         2
20
#define EI_MAG3         3
21
#define EI_CLASS        4
22
#define EI_DATA         5
23
#define EI_VERSION      6
24
#define EI_PAD          7
25
#define EI_NIDENT       16
26
 
27
#define ELFMAG0         0x7F
28
#define ELFMAG1         'E'
29
#define ELFMAG2         'L'
30
#define ELFMAG3         'F'
31
 
32
#define ELFCLASSNONE    0
33
#define ELFCLASS32      1
34
#define ELFCLASS64      2
35
 
36
#define ELFDATANONE     0
37
#define ELFDATA2LSB     1
38
#define ELFDATA2MSB     2
39
 
40
#define ET_NONE         0
41
#define ET_REL          1
42
#define ET_EXEC         2
43
#define ET_DYN          3
44
#define ET_CORE         4
45
 
46
#define EM_NONE         0
47
#define EM_M32          1
48
#define EM_SPARC        2
49
#define EM_386          3
50
#define EM_68K          4
51
#define EM_88K          5
52
#define EM_860          7
53
#define EM_MIPS         8
54
#define EM_ECO32        0xEC05
55
 
56
typedef struct {
57
  unsigned char e_ident[EI_NIDENT];
58
  Elf32_Half    e_type;
59
  Elf32_Half    e_machine;
60
  Elf32_Word    e_version;
61
  Elf32_Addr    e_entry;
62
  Elf32_Off     e_phoff;
63
  Elf32_Off     e_shoff;
64
  Elf32_Word    e_flags;
65
  Elf32_Half    e_ehsize;
66
  Elf32_Half    e_phentsize;
67
  Elf32_Half    e_phnum;
68
  Elf32_Half    e_shentsize;
69
  Elf32_Half    e_shnum;
70
  Elf32_Half    e_shstrndx;
71
} Elf32_Ehdr;
72
 
73
 
74
#define SHT_NULL        0
75
#define SHT_PROGBITS    1
76
#define SHT_SYMTAB      2
77
#define SHT_STRTAB      3
78
#define SHT_RELA        4
79
#define SHT_HASH        5
80
#define SHT_DYNAMIC     6
81
#define SHT_NOTE        7
82
#define SHT_NOBITS      8
83
#define SHT_REL         9
84
#define SHT_SHLIB       10
85
#define SHT_DYNSYM      11
86
#define SHT_LOPROC      0x70000000
87
#define SHT_HIPROC      0x7FFFFFFF
88
#define SHT_LOUSER      0x80000000
89
#define SHT_HIUSER      0xFFFFFFFF
90
 
91
#define SHF_WRITE       0x00000001
92
#define SHF_ALLOC       0x00000002
93
#define SHF_EXECINSTR   0x00000004
94
#define SHF_MASKPROC    0xF0000000
95
 
96
typedef struct {
97
  Elf32_Word    sh_name;
98
  Elf32_Word    sh_type;
99
  Elf32_Word    sh_flags;
100
  Elf32_Addr    sh_addr;
101
  Elf32_Off     sh_offset;
102
  Elf32_Word    sh_size;
103
  Elf32_Word    sh_link;
104
  Elf32_Word    sh_info;
105
  Elf32_Word    sh_addralign;
106
  Elf32_Word    sh_entsize;
107
} Elf32_Shdr;
108
 
109
 
110
#define PT_NULL         0
111
#define PT_LOAD         1
112
#define PT_DYNAMIC      2
113
#define PT_INTERP       3
114
#define PT_NOTE         4
115
#define PT_SHLIB        5
116
#define PT_PHDR         6
117
#define PT_TLS          7
118
 
119
typedef struct {
120
  Elf32_Word    p_type;
121
  Elf32_Off     p_offset;
122
  Elf32_Addr    p_vaddr;
123
  Elf32_Addr    p_paddr;
124
  Elf32_Word    p_filesz;
125
  Elf32_Word    p_memsz;
126
  Elf32_Word    p_flags;
127
  Elf32_Word    p_align;
128
} Elf32_Phdr;
129
 
130
 
131
#endif /* _ELF_H_ */

powered by: WebSVN 2.1.0

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