Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1051 | tullio | 1 | //////////////////////////////////////////////////////////////////////// |
2 | // format.h |
||
3 | // |
||
4 | // DynaLink for S.H.A.R.K |
||
5 | // Dynamic ELF object linker. |
||
6 | // |
||
7 | // Original code written by Luca Abeni. |
||
8 | // Adapted by Lex Nahumury 19-7-2006. |
||
9 | // |
||
10 | // This is free software; see GPL.txt |
||
11 | //////////////////////////////////////////////////////////////////////// |
||
12 | |||
13 | #ifndef __FORMAT_H__ |
||
14 | #define __FORMAT_H__ |
||
15 | |||
16 | #define EXTERN_SYMBOL 0xFF00 |
||
17 | #define COMMON_SYMBOL 0xFF01 |
||
18 | #define NULL_SYMBOL 0xFFFF |
||
19 | |||
20 | #define REL_TYPE_ELF_ABSOLUTE 1 |
||
21 | #define REL_TYPE_RELATIVE 4 |
||
22 | |||
23 | #define NEED_IMAGE_RELOCATION 1 |
||
24 | #define NEED_SECTION_RELOCATION 2 |
||
25 | #define NEED_LOAD_RELOCATABLE 4 |
||
26 | #define NO_ENTRY 16 |
||
27 | #define DLL_WITH_STDCALL 32 |
||
28 | |||
29 | |||
30 | struct reloc_info { |
||
31 | DWORD offset; |
||
32 | int symbol; |
||
33 | int type; |
||
34 | }; |
||
35 | |||
36 | |||
37 | struct symbol_info { |
||
38 | char *name; |
||
39 | DWORD offset; |
||
40 | WORD section; |
||
41 | }; |
||
42 | |||
43 | struct table_info { |
||
44 | DWORD section_header; |
||
45 | WORD num_sections; |
||
46 | WORD section_header_size; |
||
47 | WORD flags; |
||
48 | DWORD symbol; |
||
49 | DWORD num_symbols; |
||
50 | DWORD symbol_size; |
||
51 | DWORD string; |
||
52 | DWORD string_size; |
||
53 | DWORD string_buffer; |
||
54 | char *section_names; |
||
55 | DWORD section_names_size; |
||
56 | DWORD image_base; |
||
57 | DWORD local_bss; |
||
58 | DWORD local_bss_size; |
||
59 | /* In PEI, it's a pei extra info */ |
||
60 | DWORD private_info; |
||
61 | }; |
||
62 | |||
63 | struct section_info { |
||
64 | DWORD base; |
||
65 | DWORD size; |
||
66 | DWORD fileptr; |
||
67 | DWORD filesize; |
||
68 | int num_reloc; |
||
69 | struct reloc_info *reloc; |
||
70 | }; |
||
71 | |||
72 | /* Only used for ``import'' symbols... */ |
||
73 | struct symbol { |
||
74 | char *name; |
||
75 | DWORD address; |
||
76 | }; |
||
77 | |||
78 | |||
79 | struct file_ops |
||
80 | { |
||
81 | int (*file_read)( void *buffer, int len); |
||
82 | int (*file_seek)( int position, int wence); |
||
83 | int seek_set; |
||
84 | int seek_cur; |
||
85 | int file_offset; |
||
86 | char* entry_name; |
||
87 | }; |
||
88 | |||
89 | |||
90 | #endif |