Cleanup in elf.c with .bss section clean; adm command mounts cdrom instead of floppy...
[ZeXOS.git] / kernel / include / elf.h
blob2297612bd10c99c2575b6eba3f864a12f4c492e3
1 /*
2 * ZeX/OS
3 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _ELF_H
21 #define _ELF_H
23 #define __PACKED__ __attribute__ ((__packed__))
26 typedef struct
28 unsigned long sect_name __PACKED__;
29 unsigned long type __PACKED__;
30 unsigned long flags __PACKED__;
31 unsigned long virt_adr __PACKED__;
32 unsigned long offset __PACKED__;
33 unsigned long size __PACKED__;
34 unsigned long link __PACKED__;
35 unsigned long info __PACKED__;
36 unsigned long align __PACKED__;
37 unsigned long ent_size __PACKED__;
38 } elf_sect_t;
40 typedef struct
42 unsigned long adr __PACKED__;
43 unsigned char type;
44 unsigned long symtab_index : 24 __PACKED__;
45 unsigned long addend __PACKED__;
46 } elf_reloc_t;
48 typedef struct
50 unsigned long name __PACKED__;
51 unsigned long value __PACKED__;
52 unsigned long size __PACKED__;
53 unsigned type : 4 __PACKED__;
54 unsigned binding : 4 __PACKED__;
55 unsigned char zero;
56 unsigned short section __PACKED__;
57 } elf_sym_t;
59 typedef struct
61 unsigned long magic;
62 unsigned char bitness;
63 unsigned char endian;
64 unsigned char elf_ver_1;
65 unsigned char res[9];
66 unsigned short file_type __PACKED__;
67 unsigned short machine __PACKED__;
68 unsigned long elf_ver_2 __PACKED__;
69 unsigned long entry_pt __PACKED__;
70 unsigned long phtab_offset __PACKED__;
71 unsigned long shtab_offset __PACKED__;
72 unsigned long flags __PACKED__;
73 unsigned short file_hdr_size __PACKED__;
74 unsigned short phtab_ent_size __PACKED__;
75 unsigned short num_phtab_ents __PACKED__;
76 unsigned short shtab_ent_size __PACKED__;
77 unsigned short num_sects __PACKED__;
78 unsigned short shstrtab_index __PACKED__;
79 } elf_file_t;
82 /* externs */
84 #endif