iPXE
coff.h
Go to the documentation of this file.
1 #ifndef COFF_H
2 #define COFF_H
3 /* Based on the elf.h file
4  * Changed accordingly to support COFF file support
5  */
6 
7 
8 /* Values for f_flags. */
9 #define F_RELFLG 0x0001 /* If set, not reloc. info. Clear for executables */
10 #define F_EXEC 0x0002 /* No unresolved symbols. Executable file ! */
11 #define F_LNNO 0x0004 /* If set, line information numbers removed */
12 #define F_LSYMS 0x0008 /* If set, local symbols removed */
13 #define F_AR32WR 0x0100 /* Indicates little endian file */
14 
15 /* Values for e_machine (architecute). */
16 #define EM_E1 0x17a /* Magic number for Hyperstone. Big endian format */
17 
18 /* Values for f_flags. */
19 #define O_MAGIC 0x017c /* Optional's header magic number for Hyperstone */
20 
21 /* Values for s_flags. */
22 #define S_TYPE_TEXT 0x0020 /* If set, the section contains only executable */
23 #define S_TYPE_DATA 0x0040 /* If set, the section contains only initialized data */
24 #define S_TYPE_BSS 0x0080 /* If set, the section is BSS no data stored */
25 
26 
27 typedef struct
28 {
29  unsigned short f_magic; /* magic number */
30  unsigned short f_nscns; /* number of sections */
31  unsigned long f_timdat; /* time & date stamp */
32  unsigned long f_symptr; /* file pointer to symtab */
33  unsigned long f_nsyms; /* number of symtab entries */
34  unsigned short f_opthdr; /* sizeof(optional hdr) */
35  unsigned short f_flags; /* flags */
36 }
38 
39 /*
40  * Optional header.
41  */
42 typedef struct
43 {
44  unsigned short magic; /* type of file */
45  unsigned short vstamp; /* version stamp */
46  unsigned long tsize; /* text size in bytes, padded to FW bdry*/
47  unsigned long dsize; /* initialized data " " */
48  unsigned long bsize; /* uninitialized data " " */
49  unsigned long entry; /* entry pt. */
50  unsigned long text_start; /* base of text used for this file */
51  unsigned long data_start; /* base of data used for this file */
52 }
54 
55 /*
56  * Section header.
57  */
58 typedef struct
59 {
60  char s_name[8]; /* section name */
61  unsigned long s_paddr; /* physical address, aliased s_nlib */
62  unsigned long s_vaddr; /* virtual address */
63  unsigned long s_size; /* section size */
64  unsigned long s_scnptr; /* file ptr to raw data for section */
65  unsigned long s_relptr; /* file ptr to relocation */
66  unsigned long s_lnnoptr; /* file ptr to line numbers */
67  unsigned short s_nreloc; /* number of relocation entries */
68  unsigned short s_nlnno; /* number of line number entries*/
69  unsigned long s_flags; /* flags */
70 }
72 
73 #endif /* COFF_H */
unsigned long s_size
Definition: coff.h:63
unsigned short s_nreloc
Definition: coff.h:67
unsigned long bsize
Definition: coff.h:48
unsigned short f_flags
Definition: coff.h:35
unsigned long s_scnptr
Definition: coff.h:64
unsigned long tsize
Definition: coff.h:46
unsigned long text_start
Definition: coff.h:50
unsigned short s_nlnno
Definition: coff.h:68
unsigned long entry
Definition: coff.h:49
unsigned short magic
Definition: coff.h:44
unsigned short f_opthdr
Definition: coff.h:34
unsigned long s_flags
Definition: coff.h:69
unsigned long f_symptr
Definition: coff.h:32
unsigned long s_relptr
Definition: coff.h:65
unsigned short vstamp
Definition: coff.h:45
unsigned long f_timdat
Definition: coff.h:31
unsigned short f_nscns
Definition: coff.h:30
unsigned long data_start
Definition: coff.h:51
unsigned long s_lnnoptr
Definition: coff.h:66
unsigned long dsize
Definition: coff.h:47
unsigned long s_paddr
Definition: coff.h:61
unsigned long f_nsyms
Definition: coff.h:33
unsigned short f_magic
Definition: coff.h:29
unsigned long s_vaddr
Definition: coff.h:62