]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/C/GenFw/ElfConvert.h
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Source / C / GenFw / ElfConvert.h
CommitLineData
f51461c8 1/** @file\r
97fa0ee9 2Header file for Elf convert solution\r
f51461c8 3\r
d78675d1 4Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
f51461c8 5\r
2e351cbe 6SPDX-License-Identifier: BSD-2-Clause-Patent\r
f51461c8
LG
7\r
8**/\r
9\r
10#ifndef _ELF_CONVERT_H_\r
11#define _ELF_CONVERT_H_\r
12\r
13#include "elf_common.h"\r
14#include "elf32.h"\r
15#include "elf64.h"\r
16\r
17//\r
18// Externally defined variables\r
19//\r
20extern UINT32 mCoffOffset;\r
21extern CHAR8 *mInImageName;\r
22extern UINT32 mImageTimeStamp;\r
23extern UINT8 *mCoffFile;\r
24extern UINT32 mTableOffset;\r
25extern UINT32 mOutImageType;\r
d78675d1 26extern UINT32 mFileBufferSize;\r
f51461c8
LG
27\r
28//\r
29// Common EFI specific data.\r
30//\r
31#define ELF_HII_SECTION_NAME ".hii"\r
621bb723 32#define ELF_STRTAB_SECTION_NAME ".strtab"\r
54b1b57a 33#define MAX_COFF_ALIGNMENT 0x10000\r
f51461c8
LG
34\r
35//\r
36// Filter Types\r
37//\r
38typedef enum {\r
39 SECTION_TEXT,\r
40 SECTION_HII,\r
41 SECTION_DATA\r
f7496d71 42\r
f51461c8
LG
43} SECTION_FILTER_TYPES;\r
44\r
45//\r
fb0b35e0 46// FunctionTable\r
f51461c8
LG
47//\r
48typedef struct {\r
49 VOID (*ScanSections) ();\r
50 BOOLEAN (*WriteSections) (SECTION_FILTER_TYPES FilterType);\r
51 VOID (*WriteRelocations) ();\r
52 VOID (*WriteDebug) ();\r
53 VOID (*SetImageSize) ();\r
54 VOID (*CleanUp) ();\r
f7496d71 55\r
f51461c8
LG
56} ELF_FUNCTION_TABLE;\r
57\r
58//\r
59// Common functions\r
60//\r
61VOID\r
62CoffAddFixup (\r
63 UINT32 Offset,\r
64 UINT8 Type\r
65 );\r
66\r
67VOID\r
68CoffAddFixupEntry (\r
69 UINT16 Val\r
70 );\r
71\r
72\r
73VOID\r
74CreateSectionHeader (\r
75 const CHAR8 *Name,\r
76 UINT32 Offset,\r
77 UINT32 Size,\r
78 UINT32 Flags\r
79 );\r
80\r
81#endif\r