32 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
44 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
209 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
219 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
229 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
257 ELFYAML::ELF_EF &
Value) {
259 assert(Object &&
"The IO context is not initialized");
260 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X)
261 #define BCaseMask(X, M) IO.maskedBitSetCase(Value, #X, ELF::X, ELF::M)
262 switch (Object->Header.Machine) {
360 assert(Object &&
"The IO context is not initialized");
361 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
389 switch (Object->Header.Machine) {
416 ELFYAML::ELF_SHF &
Value) {
418 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X)
430 switch (Object->Header.Machine) {
459 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
473 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
482 ELFYAML::ELF_STO &
Value) {
484 assert(Object &&
"The IO context is not initialized");
485 #define BCase(X) IO.bitSetCase(Value, #X, ELF::X)
486 switch (Object->Header.Machine) {
502 #define ECase(X) IO.enumCase(Value, #X, ELF::X)
513 assert(Object &&
"The IO context is not initialized");
514 #define ELF_RELOC(X, Y) IO.enumCase(Value, #X, ELF::X);
515 switch (Object->Header.Machine) {
517 #include "llvm/BinaryFormat/ELFRelocs/x86_64.def"
520 #include "llvm/BinaryFormat/ELFRelocs/Mips.def"
523 #include "llvm/BinaryFormat/ELFRelocs/Hexagon.def"
527 #include "llvm/BinaryFormat/ELFRelocs/i386.def"
530 #include "llvm/BinaryFormat/ELFRelocs/AArch64.def"
533 #include "llvm/BinaryFormat/ELFRelocs/ARM.def"
536 #include "llvm/BinaryFormat/ELFRelocs/RISCV.def"
539 #include "llvm/BinaryFormat/ELFRelocs/Lanai.def"
542 #include "llvm/BinaryFormat/ELFRelocs/AMDGPU.def"
545 #include "llvm/BinaryFormat/ELFRelocs/BPF.def"
556 #define ECase(X) IO.enumCase(Value, #X, Mips::AFL_##X)
566 #define ECase(X) IO.enumCase(Value, #X, Mips::Val_GNU_MIPS_ABI_##X)
580 #define ECase(X) IO.enumCase(Value, #X, Mips::AFL_##X)
585 ECase(EXT_LOONGSON_3A);
598 ECase(EXT_LOONGSON_2E);
599 ECase(EXT_LOONGSON_2F);
617 #define BCase(X) IO.bitSetCase(Value, #X, Mips::AFL_ASE_##X)
635 IO &
IO, ELFYAML::MIPS_AFL_FLAGS1 &
Value) {
636 #define BCase(X) IO.bitSetCase(Value, #X, Mips::AFL_FLAGS1_##X)
654 struct NormalizedOther {
655 NormalizedOther(
IO &)
657 NormalizedOther(IO &, uint8_t Original)
676 IO.
mapOptional(
"Visibility", Keys->Visibility, ELFYAML::ELF_STV(0));
677 IO.
mapOptional(
"Other", Keys->Other, ELFYAML::ELF_STO(0));
744 IO &
IO, std::unique_ptr<ELFYAML::Section> &
Section) {
745 ELFYAML::ELF_SHT sectionType;
747 sectionType = Section->Type;
751 switch (sectionType) {
756 sectionMapping(IO, *cast<ELFYAML::RelocationSection>(Section.get()));
776 sectionMapping(IO, *cast<ELFYAML::RawContentSection>(Section.get()));
781 IO &io, std::unique_ptr<ELFYAML::Section> &
Section) {
783 if (!RawSection || RawSection->Size >= RawSection->Content.binary_size())
785 return "Section size must be greater or equal to the content size";
790 struct NormalizedMips64RelType {
791 NormalizedMips64RelType(
IO &)
792 :
Type(ELFYAML::ELF_REL(ELF::R_MIPS_NONE)),
793 Type2(ELFYAML::ELF_REL(ELF::R_MIPS_NONE)),
794 Type3(ELFYAML::ELF_REL(ELF::R_MIPS_NONE)),
796 NormalizedMips64RelType(IO &, ELFYAML::ELF_REL Original)
797 :
Type(Original & 0xFF),
Type2(Original >> 8 & 0xFF),
798 Type3(Original >> 16 & 0xFF),
SpecSym(Original >> 24 & 0xFF) {}
800 ELFYAML::ELF_REL denormalize(IO &) {
816 assert(Object &&
"The IO context is not initialized");
821 if (Object->Header.Machine == ELFYAML::ELF_EM(
ELF::EM_MIPS) &&
826 IO.
mapOptional(
"Type2", Key->Type2, ELFYAML::ELF_REL(ELF::R_MIPS_NONE));
827 IO.
mapOptional(
"Type3", Key->Type3, ELFYAML::ELF_REL(ELF::R_MIPS_NONE));
ArrayRef< uint8_t >::size_type binary_size() const
The number of bytes that are represented by this BinaryRef.
This file declares classes for handling the YAML representation of ELF.
void mapOptional(const char *Key, T &Val)
llvm::yaml::Hex16 Version
llvm::yaml::Hex64 Address
ELFYAML::ELF_STV Visibility
LocalGlobalWeakSymbols Symbols
llvm::yaml::Hex64 AddressAlign
std::vector< Symbol > Weak
static void groupSectionMapping(IO &IO, ELFYAML::Group &group)
void enumFallback(T &Val)
StringRef sectionNameOrType
This class should be specialized by any type that needs to be converted to/from a YAML mapping...
std::vector< Symbol > Global
virtual bool mapTag(StringRef Tag, bool Default=false)=0
void enumCase(T &Val, const char *Str, const T ConstVal)
static void commonSectionMapping(IO &IO, ELFYAML::Section &Section)
The instances of the Type class are immutable: once they are created, they are never changed...
std::vector< std::unique_ptr< Section > > Sections
std::vector< Symbol > Local
llvm::yaml::Hex8 ISARevision
This class should be specialized by any integral type that converts to/from a YAML scalar where there...
#define LLVM_YAML_STRONG_TYPEDEF(_base, _type)
YAML I/O does conversion based on types.
std::vector< SectionOrType > Members
llvm_unreachable("Unknown RegBank!")
MIPS_AFL_EXT ISAExtension
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
virtual bool outputting()=0
This class should be specialized by any integer type that is a union of bit values and the YAML repre...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
static void sectionMapping(IO &IO, ELFYAML::RawContentSection &Section)
StringRef - Represent a constant reference to a string, i.e.
void mapRequired(const char *Key, T &Val)
std::vector< Relocation > Relocations