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