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