forked from sebastianbiallas/ht
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fltstruc.h
55 lines (47 loc) · 1.8 KB
/
fltstruc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* HT Editor
* fltstruc.h
*
* Copyright (C) 2003 Sebastian Biallas ([email protected])
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __FLTSTRUC_H__
#define __FLTSTRUC_H__
#include "io/types.h"
#define FLTMAG0 'b'
#define FLTMAG1 'F'
#define FLTMAG2 'L'
#define FLTMAG3 'T'
struct flat_hdr {
byte magic[4]; /* bFLT magic */
uint32 version; /* binfmt_flat version */
uint32 entry; /* Offset of first executable instruction with text segment from beginning of file*/
uint32 data_start; /* Offset of data segment from beginning of file*/
uint32 data_end; /* Offset of end of data segment from beginning of file*/
uint32 bss_end; /* Offset of end of bss segment from beginning of file*/
/* (It is assumed that data_end through bss_end for bss segment.) */
uint32 stack_size; /* Size of stack, in bytes */
uint32 reloc_start; /* Offset of relocation records from beginning of file */
uint32 reloc_count; /* Number of relocation records */
uint32 filler[7]; /* Reservered, set to zero */
};
#define FLAT_RELOC_TYPE_TEXT 0
#define FLAT_RELOC_TYPE_DATA 1
#define FLAT_RELOC_TYPE_BSS 2
struct flat_reloc {
uint32 value; /* 2: type, 30: offset */
};
extern byte FLAT_HEADER_struct[20];
#endif /* __FLTSTRUC_H__ */