llvm/llvm/lib/Object/ELF.cpp

//===- ELF.cpp - ELF object file implementation ---------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#include "llvm/Object/ELF.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/DataExtractor.h"

usingnamespacellvm;
usingnamespaceobject;

#define STRINGIFY_ENUM_CASE(ns, name)

#define ELF_RELOC

StringRef llvm::object::getELFRelocationTypeName(uint32_t Machine,
                                                 uint32_t Type) {}

#undef ELF_RELOC

uint32_t llvm::object::getELFRelativeRelocationType(uint32_t Machine) {}

StringRef llvm::object::getELFSectionTypeName(uint32_t Machine, unsigned Type) {}

template <class ELFT>
std::vector<typename ELFT::Rel>
ELFFile<ELFT>::decode_relrs(Elf_Relr_Range relrs) const {}

template <class ELFT>
Expected<uint64_t>
ELFFile<ELFT>::getCrelHeader(ArrayRef<uint8_t> Content) const {}

template <class ELFT>
Expected<typename ELFFile<ELFT>::RelsOrRelas>
ELFFile<ELFT>::decodeCrel(ArrayRef<uint8_t> Content) const {}

template <class ELFT>
Expected<typename ELFFile<ELFT>::RelsOrRelas>
ELFFile<ELFT>::crels(const Elf_Shdr &Sec) const {}

template <class ELFT>
Expected<std::vector<typename ELFT::Rela>>
ELFFile<ELFT>::android_relas(const Elf_Shdr &Sec) const {}

template <class ELFT>
std::string ELFFile<ELFT>::getDynamicTagAsString(unsigned Arch,
                                                 uint64_t Type) const {}

template <class ELFT>
std::string ELFFile<ELFT>::getDynamicTagAsString(uint64_t Type) const {}

template <class ELFT>
Expected<typename ELFT::DynRange> ELFFile<ELFT>::dynamicEntries() const {}

template <class ELFT>
Expected<const uint8_t *>
ELFFile<ELFT>::toMappedAddr(uint64_t VAddr, WarningHandler WarnHandler) const {}

// Helper to extract and decode the next ULEB128 value as unsigned int.
// Returns zero and sets ULEBSizeErr if the ULEB128 value exceeds the unsigned
// int limit.
// Also returns zero if ULEBSizeErr is already in an error state.
// ULEBSizeErr is an out variable if an error occurs.
template <typename IntTy, std::enable_if_t<std::is_unsigned_v<IntTy>, int> = 0>
static IntTy readULEB128As(DataExtractor &Data, DataExtractor::Cursor &Cur,
                           Error &ULEBSizeErr) {}

template <typename ELFT>
static Expected<std::vector<BBAddrMap>>
decodeBBAddrMapImpl(const ELFFile<ELFT> &EF,
                    const typename ELFFile<ELFT>::Elf_Shdr &Sec,
                    const typename ELFFile<ELFT>::Elf_Shdr *RelaSec,
                    std::vector<PGOAnalysisMap> *PGOAnalyses) {}

template <class ELFT>
Expected<std::vector<BBAddrMap>>
ELFFile<ELFT>::decodeBBAddrMap(const Elf_Shdr &Sec, const Elf_Shdr *RelaSec,
                               std::vector<PGOAnalysisMap> *PGOAnalyses) const {}

template <class ELFT>
Expected<
    MapVector<const typename ELFT::Shdr *, const typename ELFT::Shdr *>>
ELFFile<ELFT>::getSectionAndRelocations(
    std::function<Expected<bool>(const Elf_Shdr &)> IsMatch) const {}

template class LLVM_EXPORT_TEMPLATE llvm::object::ELFFile<ELF32LE>;
template class LLVM_EXPORT_TEMPLATE llvm::object::ELFFile<ELF32BE>;
template class LLVM_EXPORT_TEMPLATE llvm::object::ELFFile<ELF64LE>;
template class LLVM_EXPORT_TEMPLATE llvm::object::ELFFile<ELF64BE>;