Files
slimbootloader/BootloaderCommonPkg/Include/Library/ElfLib.h
T
Aiden Park 0066eccdb3 Re-implement ElfLib for ELF32 format image (#193)
The previous implementation has a little confusion in license header.
To avoid further annoying, simply re-implement ElfLib.
- 32bits, little-endian, executable elf only supported
- elf32.h/elf_common.h from BaseTools/Source/C/GenFw
- LoadElfImage() interface changed

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-06-17 16:58:08 -07:00

49 lines
1.2 KiB
C

/** @file
ELF library
Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __ELF_LIB_H__
#define __ELF_LIB_H__
#include <Uefi/UefiBaseType.h>
/**
Check if the image is a bootable ELF image.
@param[in] ImageBase Memory address of an image
@retval TRUE Image is a bootable ELF image
@retval FALSE Not a bootable ELF image
**/
BOOLEAN
EFIAPI
IsElfImage (
IN CONST VOID *ImageBase
);
/**
Load the ELF image to specified address in ELF header.
This function loads ELF image segments into memory address specified
in ELF program header.
@param[in] ImageBase Memory address of an image.
@param[out] EntryPoint The entry point of loaded ELF image.
@retval EFI_INVALID_PARAMETER Input parameters are not valid.
@retval EFI_UNSUPPORTED Unsupported binary type.
@retval EFI_LOAD_ERROR ELF binary loading error.
@retval EFI_SUCCESS ELF binary is loaded successfully.
**/
EFI_STATUS
LoadElfImage (
IN CONST VOID *ImageBase,
OUT VOID **EntryPoint
);
#endif /* __ELF_LIB_H__ */