Files
compute-runtime/core/elf/reader.h
Daria Hinz 2196f7e216 Move ElfLib to core
Change-Id: I57987e871aac9c72dc786661c1d24f5024dd367b
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
2019-10-18 08:31:12 +02:00

40 lines
1.1 KiB
C++

/*
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "types.h"
namespace CLElfLib {
using ElfSectionHeaderStorage = std::vector<SElf64SectionHeader>;
/******************************************************************************\
Class: CElfReader
Description: Class to provide simpler interaction with the ELF standard
binary object. SElf64Header defines the ELF header type and
SElf64SectionHeader defines the section header type.
\******************************************************************************/
class CElfReader {
public:
CElfReader(ElfBinaryStorage &elfBinary);
ElfSectionHeaderStorage &getSectionHeaders() {
return sectionHeaders;
}
const SElf64Header *getElfHeader();
char *getSectionData(Elf64_Off dataOffset);
protected:
void validateElfBinary(ElfBinaryStorage &elfBinary);
ElfSectionHeaderStorage sectionHeaders;
char *beginBinary;
const SElf64Header *elf64Header;
};
} // namespace CLElfLib