]>
Commit | Line | Data |
---|---|---|
40d841f6 LG |
1 | /** @file |
2 | ||
3 | Copyright (c) 2010, Intel Corporation. All rights reserved.<BR> | |
4 | ||
5 | This program and the accompanying materials are licensed and made available | |
6 | under the terms and conditions of the BSD License which accompanies this | |
7 | distribution. The full text of the license may be found at | |
8 | http://opensource.org/licenses/bsd-license.php | |
9 | ||
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | |
12 | ||
13 | **/ | |
14 | ||
15 | #ifndef _ELF_CONVERT_H_ | |
16 | #define _ELF_CONVERT_H_ | |
17 | ||
18 | #include "elf_common.h" | |
19 | #include "elf32.h" | |
20 | #include "elf64.h" | |
21 | ||
22 | // | |
23 | // Externally defined variables | |
24 | // | |
25 | extern UINT32 mCoffOffset; | |
26 | extern CHAR8 *mInImageName; | |
27 | extern UINT32 mImageTimeStamp; | |
28 | extern UINT8 *mCoffFile; | |
29 | extern UINT32 mTableOffset; | |
30 | ||
31 | // | |
32 | // Common EFI specific data. | |
33 | // | |
34 | #define ELF_HII_SECTION_NAME ".hii" | |
35 | ||
36 | // | |
37 | // Filter Types | |
38 | // | |
39 | typedef enum { | |
40 | SECTION_TEXT, | |
41 | SECTION_HII, | |
42 | SECTION_DATA | |
43 | ||
44 | } SECTION_FILTER_TYPES; | |
45 | ||
46 | // | |
47 | // FunctionTalbe | |
48 | // | |
49 | typedef struct { | |
50 | VOID (*ScanSections) (); | |
51 | BOOLEAN (*WriteSections) (SECTION_FILTER_TYPES FilterType); | |
52 | VOID (*WriteRelocations) (); | |
53 | VOID (*WriteDebug) (); | |
54 | VOID (*SetImageSize) (); | |
55 | VOID (*CleanUp) (); | |
56 | ||
57 | } ELF_FUNCTION_TABLE; | |
58 | ||
59 | // | |
60 | // Common functions | |
61 | // | |
62 | VOID | |
63 | CoffAddFixup ( | |
64 | UINT32 Offset, | |
65 | UINT8 Type | |
66 | ); | |
67 | ||
68 | VOID | |
69 | CoffAddFixupEntry ( | |
70 | UINT16 Val | |
71 | ); | |
72 | ||
73 | ||
74 | VOID | |
75 | CreateSectionHeader ( | |
76 | const CHAR8 *Name, | |
77 | UINT32 Offset, | |
78 | UINT32 Size, | |
79 | UINT32 Flags | |
80 | ); | |
81 | ||
82 | #endif |