]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/GenFw/ElfConvert.h
BaseTools/GenFw: Update to handle PE image with .code section only
[mirror_edk2.git] / BaseTools / Source / C / GenFw / ElfConvert.h
index edd9d529580fb4d76fbd4a0013d2f768170d56e9..abf434dd11c8fdd74a545998d14777b225947637 100644 (file)
@@ -1,82 +1,86 @@
-/** @file
-
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
-
-This program and the accompanying materials are licensed and made available 
-under the terms and conditions of the BSD License which accompanies this 
-distribution.  The full text of the license may be found at 
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _ELF_CONVERT_H_
-#define _ELF_CONVERT_H_
-
-#include "elf_common.h"
-#include "elf32.h"
-#include "elf64.h"
-
-//
-// Externally defined variables
-//
-extern UINT32 mCoffOffset;
-extern CHAR8  *mInImageName;
-extern UINT32 mImageTimeStamp;
-extern UINT8  *mCoffFile;
-extern UINT32 mTableOffset;
-
-//
-// Common EFI specific data.
-//
-#define ELF_HII_SECTION_NAME ".hii"
-
-//
-// Filter Types
-//
-typedef enum {
-  SECTION_TEXT,
-  SECTION_HII,
-  SECTION_DATA
-  
-} SECTION_FILTER_TYPES;
-
-//
-// FunctionTalbe
-//
-typedef struct {
-  VOID    (*ScanSections) ();
-  BOOLEAN (*WriteSections) (SECTION_FILTER_TYPES  FilterType);
-  VOID    (*WriteRelocations) ();
-  VOID    (*WriteDebug) ();
-  VOID    (*SetImageSize) ();
-  VOID    (*CleanUp) ();
-  
-} ELF_FUNCTION_TABLE;
-
-//
-// Common functions
-//
-VOID
-CoffAddFixup (
-  UINT32 Offset,
-  UINT8  Type
-  );
-
-VOID
-CoffAddFixupEntry (
-  UINT16 Val
-  );
-
-
-VOID
-CreateSectionHeader (
-  const CHAR8 *Name,
-  UINT32      Offset,
-  UINT32      Size,
-  UINT32      Flags
-  );
-
-#endif
+/** @file\r
+Header file for Elf convert solution\r
+\r
+Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+\r
+This program and the accompanying materials are licensed and made available \r
+under the terms and conditions of the BSD License which accompanies this \r
+distribution.  The full text of the license may be found at \r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _ELF_CONVERT_H_\r
+#define _ELF_CONVERT_H_\r
+\r
+#include "elf_common.h"\r
+#include "elf32.h"\r
+#include "elf64.h"\r
+\r
+//\r
+// Externally defined variables\r
+//\r
+extern UINT32 mCoffOffset;\r
+extern CHAR8  *mInImageName;\r
+extern UINT32 mImageTimeStamp;\r
+extern UINT8  *mCoffFile;\r
+extern UINT32 mTableOffset;\r
+extern UINT32 mOutImageType;\r
+\r
+//\r
+// Common EFI specific data.\r
+//\r
+#define ELF_HII_SECTION_NAME ".hii"\r
+#define ELF_STRTAB_SECTION_NAME ".strtab"\r
+#define MAX_COFF_ALIGNMENT 0x10000\r
+\r
+//\r
+// Filter Types\r
+//\r
+typedef enum {\r
+  SECTION_TEXT,\r
+  SECTION_HII,\r
+  SECTION_DATA\r
+  \r
+} SECTION_FILTER_TYPES;\r
+\r
+//\r
+// FunctionTalbe\r
+//\r
+typedef struct {\r
+  VOID    (*ScanSections) ();\r
+  BOOLEAN (*WriteSections) (SECTION_FILTER_TYPES  FilterType);\r
+  VOID    (*WriteRelocations) ();\r
+  VOID    (*WriteDebug) ();\r
+  VOID    (*SetImageSize) ();\r
+  VOID    (*CleanUp) ();\r
+  \r
+} ELF_FUNCTION_TABLE;\r
+\r
+//\r
+// Common functions\r
+//\r
+VOID\r
+CoffAddFixup (\r
+  UINT32 Offset,\r
+  UINT8  Type\r
+  );\r
+\r
+VOID\r
+CoffAddFixupEntry (\r
+  UINT16 Val\r
+  );\r
+\r
+\r
+VOID\r
+CreateSectionHeader (\r
+  const CHAR8 *Name,\r
+  UINT32      Offset,\r
+  UINT32      Size,\r
+  UINT32      Flags\r
+  );\r
+\r
+#endif\r