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