llvm/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h

//===-- ELFHeader.h ------------------------------------------- -*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
/// \file
/// Generic structures and typedefs for ELF files.
///
/// This file provides definitions for the various entities comprising an ELF
/// file.  The structures are generic in the sense that they do not correspond
/// to the exact binary layout of an ELF, but can be used to hold the
/// information present in both 32 and 64 bit variants of the format.  Each
/// entity provides a \c Parse method which is capable of transparently
/// reading both 32 and 64 bit instances of the object.
//===----------------------------------------------------------------------===//

#ifndef LLDB_SOURCE_PLUGINS_OBJECTFILE_ELF_ELFHEADER_H
#define LLDB_SOURCE_PLUGINS_OBJECTFILE_ELF_ELFHEADER_H

#include "llvm/BinaryFormat/ELF.h"

#include "lldb/lldb-enumerations.h"
#include "lldb/lldb-types.h"

namespace lldb_private {
class DataExtractor;
} // End namespace lldb_private.

namespace elf {

/// \name ELF type definitions.
///
/// Types used to represent the various components of ELF structures.  All
/// types are signed or unsigned integral types wide enough to hold values
/// from both
/// 32 and 64 bit ELF variants.
//@{
elf_addr;
elf_off;
elf_half;
elf_word;
elf_sword;
elf_size;
elf_xword;
elf_sxword;
//@}

/// \class ELFHeader
/// Generic representation of an ELF file header.
///
/// This object is used to identify the general attributes on an ELF file and
/// to locate additional sections within the file.
struct ELFHeader {};

/// \class ELFSectionHeader
/// Generic representation of an ELF section header.
struct ELFSectionHeader {};

/// \class ELFProgramHeader
/// Generic representation of an ELF program header.
struct ELFProgramHeader {};

/// \class ELFSymbol
/// Represents a symbol within an ELF symbol table.
struct ELFSymbol {};

/// \class ELFDynamic
/// Represents an entry in an ELF dynamic table.
struct ELFDynamic {};

/// \class ELFRel
/// Represents a relocation entry with an implicit addend.
struct ELFRel {};

/// \class ELFRela
/// Represents a relocation entry with an explicit addend.
struct ELFRela {};

} // End namespace elf.

#endif // LLDB_SOURCE_PLUGINS_OBJECTFILE_ELF_ELFHEADER_H