alsa.audio: build the bridge link lib only for linux architecture
[AROS.git] / arch / ppc-sam440 / boot / parthenope / src / elf.h
blob95f1c1e1fa9478656765dc5d08ae15b55acfcaaa
1 #ifndef ELF_H_
2 #define ELF_H_
4 /*
5 * $Id$
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
23 #include "context.h"
25 struct bss_tracker {
26 void *addr;
27 unsigned int length;
30 extern struct bss_tracker tracker[];
32 int load_elf_file(const char *name, void *file);
33 char *get_ptr_rw();
34 char *get_ptr_ro();
36 #define SHT_PROGBITS 1
37 #define SHT_SYMTAB 2
38 #define SHT_STRTAB 3
39 #define SHT_RELA 4
40 #define SHT_NOBITS 8
41 #define SHT_REL 9
43 #define ET_REL 1
44 #define EM_386 3
45 #define EM_PPC 20
46 #define EM_X86_64 62
48 #define STT_OBJECT 1
49 #define STT_FUNC 2
51 #define SHN_ABS 0xfff1
52 #define SHN_COMMON 0xfff2
53 #define SHN_UNDEF 0
55 #define SHF_WRITE (1 << 0)
56 #define SHF_ALLOC (1 << 1)
57 #define SHF_EXECINSTR (1 << 2)
59 #define R_386_NONE 0
60 #define R_386_32 1
61 #define R_386_PC32 2
63 #define R_X86_64_NONE 0
64 #define R_X86_64_64 1
65 #define R_X86_64_PC32 2
66 #define R_X86_64_32 10
67 #define R_X86_64_32S 11
69 #define R_PPC_NONE 0
70 #define R_PPC_ADDR32 1
71 #define R_PPC_ADDR16_LO 4
72 #define R_PPC_ADDR16_HA 6
73 #define R_PPC_REL24 10
74 #define R_PPC_REL32 26
76 #define ELF64_ST_TYPE(i) ((i) & 0x0F)
78 #define ELF64_R_SYM(i) (unsigned long)((i) >> 32)
79 #define ELF64_R_TYPE(i) (unsigned long)((i) & 0xffffffffULL)
80 #define ELF64_R_INFO(sym, type) (((unsigned long long)(sym) << 32) + (type))
82 #define ELF32_R_SYM(i) ((i) >> 8)
83 #define ELF32_R_TYPE(i) ((i) & 0xff)
84 #define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
86 struct elfheader {
87 uint8_t ident[16];
88 uint16_t type;
89 uint16_t machine;
90 uint32_t version;
91 uint32_t entry;
92 uint32_t phoff;
93 uint32_t shoff;
94 uint32_t flags;
95 uint16_t ehsize;
96 uint16_t phentsize;
97 uint16_t phnum;
98 uint16_t shentsize;
99 uint16_t shnum;
100 uint16_t shstrndx;
103 struct sheader {
104 uint32_t name;
105 uint32_t type;
106 uint32_t flags;
107 uint32_t addr;
108 uint32_t offset;
109 uint32_t size;
110 uint32_t link;
111 uint32_t info;
112 uint32_t addralign;
113 uint32_t entsize;
116 struct pheader {
117 uint32_t p_type; /* Segment type */
118 uint32_t p_offset; /* Segment file offset */
119 uint32_t p_vaddr; /* Segment virtual address */
120 uint32_t p_paddr; /* Segment physical address */
121 uint32_t p_filesz; /* Segment size in file */
122 uint32_t p_memsz; /* Segment size in memory */
123 uint32_t p_flags; /* Segment flags */
124 uint32_t p_align; /* Segment alignment */
127 struct symbol {
128 uint32_t name;
129 uint32_t value;
130 uint32_t size;
131 uint8_t info;
132 uint8_t other;
133 uint16_t shindex;
136 struct relo {
137 uint32_t offset;
138 uint32_t info;
139 int32_t addend;
142 #endif /*ELF_H_ */