]>
Commit | Line | Data |
---|---|---|
40d841f6 LG |
1 | /** @file |
2 | ||
da92f276 | 3 | Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR> |
40d841f6 LG |
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; | |
da92f276 | 30 | extern UINT32 mOutImageType; |
40d841f6 LG |
31 | |
32 | // | |
33 | // Common EFI specific data. | |
34 | // | |
35 | #define ELF_HII_SECTION_NAME ".hii" | |
36 | ||
37 | // | |
38 | // Filter Types | |
39 | // | |
40 | typedef enum { | |
41 | SECTION_TEXT, | |
42 | SECTION_HII, | |
43 | SECTION_DATA | |
44 | ||
45 | } SECTION_FILTER_TYPES; | |
46 | ||
47 | // | |
48 | // FunctionTalbe | |
49 | // | |
50 | typedef struct { | |
51 | VOID (*ScanSections) (); | |
52 | BOOLEAN (*WriteSections) (SECTION_FILTER_TYPES FilterType); | |
53 | VOID (*WriteRelocations) (); | |
54 | VOID (*WriteDebug) (); | |
55 | VOID (*SetImageSize) (); | |
56 | VOID (*CleanUp) (); | |
57 | ||
58 | } ELF_FUNCTION_TABLE; | |
59 | ||
60 | // | |
61 | // Common functions | |
62 | // | |
63 | VOID | |
64 | CoffAddFixup ( | |
65 | UINT32 Offset, | |
66 | UINT8 Type | |
67 | ); | |
68 | ||
69 | VOID | |
70 | CoffAddFixupEntry ( | |
71 | UINT16 Val | |
72 | ); | |
73 | ||
74 | ||
75 | VOID | |
76 | CreateSectionHeader ( | |
77 | const CHAR8 *Name, | |
78 | UINT32 Offset, | |
79 | UINT32 Size, | |
80 | UINT32 Flags | |
81 | ); | |
82 | ||
83 | #endif |