mirror of
				https://git.proxmox.com/git/mirror_edk2
				synced 2025-10-30 23:50:23 +00:00 
			
		
		
		
	 54b1b57a59
			
		
	
	
		54b1b57a59
		
	
	
	
	
		
			
			Get maximum section alignment from each ELF section, and this alignment is used to create PE header. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17727 6f19259b-4bc3-4df7-8a09-765794883524
		
			
				
	
	
		
			86 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			86 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| /** @file
 | |
| Header file for Elf convert solution
 | |
| 
 | |
| Copyright (c) 2010 - 2014, 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;
 | |
| extern UINT32 mOutImageType;
 | |
| 
 | |
| //
 | |
| // Common EFI specific data.
 | |
| //
 | |
| #define ELF_HII_SECTION_NAME ".hii"
 | |
| #define MAX_COFF_ALIGNMENT 0x10000
 | |
| 
 | |
| //
 | |
| // 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
 |