LLVM  10.0.0svn
Namespaces | Functions
ELFEmitter.cpp File Reference

The ELF component of yaml2obj. More...

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/MC/StringTableBuilder.h"
#include "llvm/Object/ELFObjectFile.h"
#include "llvm/ObjectYAML/ELFYAML.h"
#include "llvm/ObjectYAML/yaml2obj.h"
#include "llvm/Support/EndianStream.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Support/raw_ostream.h"
Include dependency graph for ELFEmitter.cpp:

Go to the source code of this file.

Namespaces

 llvm
 This class represents lattice values for constants.
 
 llvm::yaml
 

Functions

template<class T >
static size_t arrayDataSize (ArrayRef< T > A)
 
template<class T >
static void writeArrayData (raw_ostream &OS, ArrayRef< T > A)
 
template<class T >
static void zero (T &Obj)
 
static size_t findFirstNonGlobal (ArrayRef< ELFYAML::Symbol > Symbols)
 
static uint64_t writeContent (raw_ostream &OS, const Optional< yaml::BinaryRef > &Content, const Optional< llvm::yaml::Hex64 > &Size)
 
static bool isMips64EL (const ELFYAML::Object &Doc)
 
bool llvm::yaml::yaml2elf (ELFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH)
 

Detailed Description

The ELF component of yaml2obj.

Definition in file ELFEmitter.cpp.

Function Documentation

◆ arrayDataSize()

template<class T >
static size_t arrayDataSize ( ArrayRef< T A)
static

Definition at line 189 of file ELFEmitter.cpp.

References llvm::ArrayRef< T >::size(), and T.

Referenced by writeArrayData(), and writeContent().

◆ findFirstNonGlobal()

static size_t findFirstNonGlobal ( ArrayRef< ELFYAML::Symbol Symbols)
static

Definition at line 459 of file ELFEmitter.cpp.

References I, llvm::ArrayRef< T >::size(), and llvm::ELF::STB_LOCAL.

Referenced by writeContent().

◆ isMips64EL()

static bool isMips64EL ( const ELFYAML::Object Doc)
static

Definition at line 719 of file ELFEmitter.cpp.

References llvm::ELFYAML::StackSizeEntry::Address, llvm::ELFYAML::MipsABIFlags::ASEs, llvm::object::Elf_Mips_ABIFlags< ELFT >::ases, assert(), llvm::ELFYAML::VerneedEntry::AuxV, llvm::ELFYAML::HashSection::Bucket, llvm::ELFYAML::HashSection::Chain, llvm::ELFYAML::FileHeader::Class, llvm::ELFYAML::StackSizesSection::Content, llvm::ELFYAML::DynamicSection::Content, llvm::ELFYAML::HashSection::Content, llvm::ELFYAML::AddrsigSection::Content, llvm::object::Elf_Mips_ABIFlags< ELFT >::cpr1_size, llvm::ELFYAML::MipsABIFlags::CPR1Size, llvm::object::Elf_Mips_ABIFlags< ELFT >::cpr2_size, llvm::ELFYAML::MipsABIFlags::CPR2Size, llvm::ELFYAML::FileHeader::Data, llvm::ELFYAML::dropUniqueSuffix(), E, llvm::ELF::ELFCLASS64, llvm::ELF::ELFDATA2LSB, llvm::ELF::EM_MIPS, llvm::StringRef::empty(), llvm::encodeULEB128(), llvm::ELFYAML::StackSizesSection::Entries, llvm::ELFYAML::DynamicSection::Entries, llvm::ELFYAML::SymverSection::Entries, llvm::ELFYAML::VerdefSection::Entries, llvm::ELFYAML::SymtabShndxSection::Entries, llvm::ELFYAML::Section::EntSize, llvm::ELFYAML::VerneedEntry::File, llvm::ELFYAML::VernauxEntry::Flags, llvm::ELFYAML::VerdefEntry::Flags, llvm::ELFYAML::MipsABIFlags::Flags1, llvm::object::Elf_Mips_ABIFlags< ELFT >::flags1, llvm::ELFYAML::MipsABIFlags::Flags2, llvm::object::Elf_Mips_ABIFlags< ELFT >::flags2, llvm::object::Elf_Mips_ABIFlags< ELFT >::fp_abi, llvm::ELFYAML::MipsABIFlags::FpABI, llvm::object::Elf_Mips_ABIFlags< ELFT >::gpr_size, llvm::ELFYAML::MipsABIFlags::GPRSize, llvm::ELF::GRP_COMDAT, llvm::ELFYAML::VernauxEntry::Hash, llvm::ELFYAML::VerdefEntry::Hash, llvm::ELFYAML::Object::Header, I, if(), llvm::ELFYAML::AddrsigSymbol::Index, llvm::ELFYAML::VerneedSection::Info, llvm::ELFYAML::VerdefSection::Info, llvm::object::Elf_Mips_ABIFlags< ELFT >::isa_ext, llvm::object::Elf_Mips_ABIFlags< ELFT >::isa_level, llvm::object::Elf_Mips_ABIFlags< ELFT >::isa_rev, llvm::ELFYAML::MipsABIFlags::ISAExtension, llvm::ELFYAML::MipsABIFlags::ISALevel, llvm::ELFYAML::MipsABIFlags::ISARevision, llvm::ELFYAML::Section::Link, llvm::codeview::Link, llvm::ELFYAML::FileHeader::Machine, llvm::makeArrayRef(), llvm::ELFYAML::Group::Members, llvm::ELFYAML::Symbol::Name, llvm::ELFYAML::Section::Name, llvm::ELFYAML::VernauxEntry::Name, llvm::ELFYAML::AddrsigSymbol::Name, llvm::ELFYAML::VernauxEntry::Other, llvm::ELFYAML::Object::ProgramHeaders, llvm::ELFYAML::RelocationSection::RelocatableSec, llvm::ELFYAML::RelocationSection::Relocations, reportError(), llvm::ELFYAML::SectionOrType::sectionNameOrType, llvm::ELF::SHT_DYNAMIC, llvm::ELF::SHT_GROUP, llvm::ELF::SHT_MIPS_ABIFLAGS, llvm::ELF::SHT_REL, llvm::ELF::SHT_RELA, llvm::ELFYAML::Group::Signature, llvm::ELFYAML::StackSizeEntry::Size, llvm::ArrayRef< T >::size(), llvm::ELFYAML::StackSizesSection::Size, llvm::ELFYAML::HashSection::Size, llvm::ELFYAML::AddrsigSection::Size, llvm::ELFYAML::AddrsigSection::Symbols, llvm::ELFYAML::DynamicEntry::Tag, llvm::ELFYAML::Section::Type, llvm::ELFYAML::DynamicEntry::Val, llvm::ELFYAML::VerdefEntry::VerNames, llvm::ELFYAML::VerneedSection::VerneedV, llvm::ELFYAML::VerneedEntry::Version, llvm::ELFYAML::VerdefEntry::Version, llvm::ELFYAML::MipsABIFlags::Version, llvm::object::Elf_Mips_ABIFlags< ELFT >::version, llvm::IndexedInstrProf::Version, llvm::ELFYAML::VerdefEntry::VersionNdx, llvm::raw_ostream::write(), writeArrayData(), writeContent(), and zero().

◆ writeArrayData()

template<class T >
static void writeArrayData ( raw_ostream OS,
ArrayRef< T A 
)
static

Definition at line 193 of file ELFEmitter.cpp.

References arrayDataSize(), llvm::ArrayRef< T >::data(), and llvm::raw_ostream::write().

Referenced by isMips64EL(), and writeContent().

◆ writeContent()

static uint64_t writeContent ( raw_ostream OS,
const Optional< yaml::BinaryRef > &  Content,
const Optional< llvm::yaml::Hex64 > &  Size 
)
static

◆ zero()

template<class T >
static void zero ( T Obj)
static