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