annotate packages/services/objloader/current/include/elf.h @ 2890:f8dd12428f1d

* cdl/objloader.cdl, src/objelf.c, src/relocate_ppc.c, src/relocate_arm.c: Eliminate dependency on CYGPKG_IO_FILEIO when the filesystem loader is not required. * src/relocate_arm.c : Added relocation software for the ARM . * src/relocate_i386.c : Added a structure containing the relocation names for every architecture. Only used (and compiled in) for pretty printing. * src/relocate_ppc.c : * include/relocate_arm.h : New header file for src/relocate_arm.c * cdl/objloader.cdl: Added the option to relocate for the ARM. * src/objloader.c : * src/objelf.c : Erased some redundant debug printout and improved the readability of the rest. * src/loader_memory.c : Added the code to allow the objloader package to load libraries from ROM memory, instead from a file system. The various sections of the library are the copied from ROM to RAM and relocated. * include/loader_memory.h : New header file for src/loader_memory.c * src/objloader.c : Added a line to include the loader_memory header file and code to flush the cache when calling cyg_ldr_find_symbol(). * cdl/objloader.cdl: Added one check boxe for each of the supported ways of loading libraries (two for now) so that the user can compile out the loading methods not used.
author jld
date Fri, 03 Jul 2009 14:49:44 +0000
parents 74dbf4c3f2e1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2011
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
1 #ifndef __ELF_H__
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
2 #define __ELF_H__
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
3
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
4 /* =================================================================
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
5 *
2243
6fd46febe457 Warnings, cosmetic fixes from Anthony Tonizzo
gthomas
parents: 2011
diff changeset
6 * elf.h
2011
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
7 *
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
8 * =================================================================
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
9 * ####ECOSGPLCOPYRIGHTBEGIN####
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
10 * -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
11 * This file is part of eCos, the Embedded Configurable Operating System.
2890
f8dd12428f1d * cdl/objloader.cdl, src/objelf.c, src/relocate_ppc.c,
jld
parents: 2729
diff changeset
12 * Copyright (C) 2005, 2008 Free Software Foundation, Inc.
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
13 *
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
14 * eCos is free software; you can redistribute it and/or modify it under
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
15 * the terms of the GNU General Public License as published by the Free
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
16 * Software Foundation; either version 2 or (at your option) any later
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
17 * version.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
18 *
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
19 * eCos is distributed in the hope that it will be useful, but WITHOUT
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
20 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
21 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
22 * for more details.
2011
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
23 *
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
24 * You should have received a copy of the GNU General Public License
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
25 * along with eCos; if not, write to the Free Software Foundation, Inc.,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
26 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2011
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
27 *
2729
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
28 * As a special exception, if other files instantiate templates or use
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
29 * macros or inline functions from this file, or you compile this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
30 * and link it with other works to produce a work based on this file,
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
31 * this file does not by itself cause the resulting work to be covered by
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
32 * the GNU General Public License. However the source code for this file
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
33 * must still be made available in accordance with section (3) of the GNU
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
34 * General Public License v2.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
35 *
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
36 * This exception does not invalidate any other reasons why a work based
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
37 * on this file might be covered by the GNU General Public License.
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
38 * -------------------------------------------
74dbf4c3f2e1 Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents: 2243
diff changeset
39 * ####ECOSGPLCOPYRIGHTEND####
2011
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
40 * =================================================================
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
41 * #####DESCRIPTIONBEGIN####
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
42 *
2243
6fd46febe457 Warnings, cosmetic fixes from Anthony Tonizzo
gthomas
parents: 2011
diff changeset
43 * Author(s): Anthony Tonizzo (atonizzo@gmail.com)
2011
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
44 * Date: 2005-05-13
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
45 * Purpose:
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
46 * Description:
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
47 *
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
48 * ####DESCRIPTIONEND####
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
49 *
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
50 * =================================================================
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
51 */
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
52
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
53 typedef cyg_uint32 Elf32_Addr;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
54 typedef cyg_uint16 Elf32_Half;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
55 typedef cyg_uint32 Elf32_Off;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
56 typedef cyg_int32 Elf32_Sword;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
57 typedef cyg_uint32 Elf32_Word;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
58
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
59 #define EI_NIDENT 16
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
60 typedef struct
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
61 {
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
62 unsigned char e_ident[EI_NIDENT];
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
63 Elf32_Half e_type;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
64 Elf32_Half e_machine;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
65 Elf32_Word e_version;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
66 Elf32_Addr e_entry;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
67 Elf32_Off e_phoff;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
68 Elf32_Off e_shoff;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
69 Elf32_Word e_flags;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
70 Elf32_Half e_ehsize;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
71 Elf32_Half e_phentsize;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
72 Elf32_Half e_phnum;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
73 Elf32_Half e_shentsize;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
74 Elf32_Half e_shnum;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
75 Elf32_Half e_shstrndx;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
76 } Elf32_Ehdr;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
77
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
78 // The ELFCLASS* macros are the defined values of e_ident[EI_CLASS].
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
79 #define ELFCLASSNONE 0 // Invalid class.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
80 #define ELFCLASS32 1 // 32-bit objects.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
81 #define ELFCLASS64 2 // 64-bit objects.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
82
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
83 // The ELFDATA* macros are the allowed values of e_ident[EI_DATA].
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
84 #define ELFDATA2LSB 1 // Little Endian
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
85 #define ELFDATA2MSB 2 // Big Endian.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
86
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
87 // The ET_* macros define the values of the e_type field of the ElfXX_Ehdr
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
88 // structure.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
89 #define ET_NONE 0 // No file type.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
90 #define ET_REL 1 // Relocatable file.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
91 #define ET_EXEC 2 // Executable file.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
92 #define ET_DYN 3 // Shared object file.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
93 #define ET_CORE 4 // Core file.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
94 #define ET_LOPROC 0xff00 // Processor-specific.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
95
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
96 // The ELFMAG* macros are the values of e_ident[EI_MAG0-4]
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
97 #define ELFMAG0 0x7f // magic number, byte 0
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
98 #define ELFMAG1 'E' // magic number, byte 1
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
99 #define ELFMAG2 'L' // magic number, byte 2
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
100 #define ELFMAG3 'F' // magic number, byte 3
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
101 #define ELFMAG "\177ELF" // magic string
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
102 #define SELFMAG 4 // magic string length
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
103
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
104 #define EI_MAG0 0
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
105 #define EI_MAG1 1
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
106 #define EI_MAG2 2
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
107 #define EI_MAG3 3
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
108 #define EI_CLASS 4
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
109 #define EI_DATA 5
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
110 #define EI_VERSION 6
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
111 #define EI_PAD 7
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
112
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
113 typedef struct
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
114 {
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
115 Elf32_Word sh_name; // section name.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
116 Elf32_Word sh_type; // SHT_...
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
117 Elf32_Word sh_flags; // SHF_...
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
118 Elf32_Addr sh_addr; // virtual address
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
119 Elf32_Off sh_offset; // file offset
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
120 Elf32_Word sh_size; // section size
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
121 Elf32_Word sh_link; // misc info
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
122 Elf32_Word sh_info; // misc info
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
123 Elf32_Word sh_addralign; // memory alignment
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
124 Elf32_Word sh_entsize; // entry size if table.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
125 } Elf32_Shdr;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
126
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
127 // Symbols table entry.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
128 typedef struct
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
129 {
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
130 Elf32_Word st_name; // Symbol name (string tbl index).
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
131 Elf32_Addr st_value; // Symbol value.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
132 Elf32_Word st_size; // Symbol size.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
133 unsigned char st_info; // Symbol type and binding.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
134 unsigned char st_other; // Symbol visibility.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
135 Elf32_Half st_shndx; // Section index.
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
136 } Elf32_Sym;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
137
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
138 typedef struct
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
139 {
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
140 Elf32_Addr r_offset;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
141 Elf32_Word r_info;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
142 } Elf32_Rel;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
143
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
144 typedef struct
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
145 {
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
146 Elf32_Addr r_offset;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
147 Elf32_Word r_info;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
148 Elf32_Sword r_addend;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
149 } Elf32_Rela;
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
150
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
151
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
152 #define SHT_NULL 0
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
153 #define SHT_PROGBITS 1
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
154 #define SHT_SYMTAB 2
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
155 #define SHT_STRTAB 3
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
156 #define SHT_RELA 4
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
157 #define SHT_HASH 5
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
158 #define SHT_DYNAMIC 6
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
159 #define SHT_NOTE 7
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
160 #define SHT_NOBITS 8
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
161 #define SHT_REL 9
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
162 #define SHT_SHLIB 10
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
163 #define SHT_DYNSYM 11
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
164
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
165 #define SHN_UNDEF 0
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
166 #define SHN_LORESERVE 0xff00
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
167 #define SHN_LOPROC 0xff00
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
168 #define SHN_HIPROC 0xff1f
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
169 #define SHN_ABS 0xfff1
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
170 #define SHN_COMMON 0xfff2
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
171 #define SHN_HIRESERVE 0xffff
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
172
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
173 #define STT_NOTYPE 0
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
174 #define STT_OBJECT 1
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
175 #define STT_FUNC 2
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
176 #define STT_SECTION 3
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
177 #define STT_FILE 4
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
178 #define STT_LOPROC 13
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
179 #define STT_HIPROC 15
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
180
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
181 #define STB_LOCAL 0
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
182 #define STB_GLOBAL 1
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
183 #define STB_WEAK 2
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
184 #define STB_LOPROC 13
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
185 #define STB_HIPROC 15
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
186
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
187 // The ELF_STRING_xxx macros are names of common sections
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
188 #define ELF_STRING_bss ".bss"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
189 #define ELF_STRING_hbss ".hbss"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
190 #define ELF_STRING_sbss ".sbss"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
191 #define ELF_STRING_tbss ".tbss"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
192 #define ELF_STRING_data ".data"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
193 #define ELF_STRING_hdata ".hdata"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
194 #define ELF_STRING_sdata ".sdata"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
195 #define ELF_STRING_sdata2 ".sdata2"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
196 #define ELF_STRING_fini ".fini"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
197 #define ELF_STRING_init ".init"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
198 #define ELF_STRING_interp ".interp"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
199 #define ELF_STRING_rodata ".rodata"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
200 #define ELF_STRING_text ".text"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
201 #define ELF_STRING_comment ".comment"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
202 #define ELF_STRING_dynamic ".dynamic"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
203 #define ELF_STRING_dynstr ".dynstr"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
204 #define ELF_STRING_dynsym ".dynsym"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
205 #define ELF_STRING_dlt ".dlt"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
206 #define ELF_STRING_note ".note"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
207 #define ELF_STRING_opd ".opd"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
208 #define ELF_STRING_plt ".plt"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
209 #define ELF_STRING_bss_rela ".rela.bss"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
210 #define ELF_STRING_hbss_rela ".rela.hbss"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
211 #define ELF_STRING_data_rela ".rela.data"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
212 #define ELF_STRING_dlt_rela ".rela.dlt"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
213 #define ELF_STRING_plt_rela ".rela.plt"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
214 #define ELF_STRING_sdata_rela ".rela.sdata"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
215 #define ELF_STRING_strtab ".strtab"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
216 #define ELF_STRING_symtab ".symtab"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
217 #define ELF_STRING_hash ".hash"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
218 #define ELF_STRING_shstrtab ".shstrtab"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
219 #define ELF_STRING_shsymtab ".shsymtab"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
220 #define ELF_STRING_rela ".rela"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
221 #define ELF_STRING_rel ".rel"
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
222
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
223 #define ELF32_R_SYM(i) ((i)>>8)
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
224 #define ELF32_R_TYPE(i) ((unsigned char)(i))
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
225
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
226 #define ELF32_ST_BIND(i) ((i)>>4)
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
227 #define ELF32_ST_TYPE(i) ((i)&0x0F)
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
228
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
229
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
230 #endif
662e1b34b811 Added OBJLOADER package.
nickg
parents:
diff changeset
231