OS.PadToColumn(2u);
OS << "Version:";
OS.PadToColumn(37u);
- OS << to_hexString(e.e_ident[ELF::EI_VERSION]);
+ OS << utohexstr(e.e_ident[ELF::EI_VERSION]);
if (e.e_version == ELF::EV_CURRENT)
OS << " (current)";
OS << "\n";
Str = E->AltName.str();
} else {
if (e.e_type >= ET_LOPROC)
- Str = "Processor Specific: (" + to_hexString(e.e_type, false) + ")";
+ Str = "Processor Specific: (" + utohexstr(e.e_type, /*LowerCase=*/true) + ")";
else if (e.e_type >= ET_LOOS)
- Str = "OS Specific: (" + to_hexString(e.e_type, false) + ")";
+ Str = "OS Specific: (" + utohexstr(e.e_type, /*LowerCase=*/true) + ")";
else
- Str = "<unknown>: " + to_hexString(e.e_type, false);
+ Str = "<unknown>: " + utohexstr(e.e_type, /*LowerCase=*/true);
}
printFields(OS, "Type:", Str);
Str = enumToString(e.e_machine, makeArrayRef(ElfMachineType));
printFields(OS, "Machine:", Str);
- Str = "0x" + to_hexString(e.e_version);
+ Str = "0x" + utohexstr(e.e_version);
printFields(OS, "Version:", Str);
- Str = "0x" + to_hexString(e.e_entry);
+ Str = "0x" + utohexstr(e.e_entry);
printFields(OS, "Entry point address:", Str);
Str = to_string(e.e_phoff) + " (bytes into file)";
printFields(OS, "Start of program headers:", Str);
else if (e.e_machine == EM_AVR)
ElfFlags = printFlags(e.e_flags, makeArrayRef(ElfHeaderAVRFlags),
unsigned(ELF::EF_AVR_ARCH_MASK));
- Str = "0x" + to_hexString(e.e_flags);
+ Str = "0x" + utohexstr(e.e_flags);
if (!ElfFlags.empty())
Str = Str + ", " + ElfFlags;
printFields(OS, "Flags:", Str);
Addend = " + ";
}
}
- Addend += to_hexString(RelAddend, false);
+ Addend += utohexstr(RelAddend, /*LowerCase=*/true);
}
OS << Addend << "\n";
}
const DynRegionInfo &Reg) {
uint64_t Offset = Reg.Addr - this->Obj.base();
OS << "\n'" << Name.str().c_str() << "' relocation section at offset 0x"
- << to_hexString(Offset, false) << " contains " << Reg.Size << " bytes:\n";
+ << utohexstr(Offset, /*LowerCase=*/true) << " contains " << Reg.Size << " bytes:\n";
printRelocHeaderFields<ELFT>(OS, Type);
}
uintX_t Offset = Sec.sh_offset;
StringRef Name = this->getPrintableSectionName(Sec);
OS << "\nRelocation section '" << Name << "' at offset 0x"
- << to_hexString(Offset, false) << " contains " << EntriesNum
+ << utohexstr(Offset, /*LowerCase=*/true) << " contains " << EntriesNum
<< " entries:\n";
printRelocHeaderFields<ELFT>(OS, Sec.sh_type);
this->printRelocationsHelper(Sec);
// returned as '<unknown>' followed by the type value.
static std::string getSectionTypeOffsetString(unsigned Type) {
if (Type >= SHT_LOOS && Type <= SHT_HIOS)
- return "LOOS+0x" + to_hexString(Type - SHT_LOOS);
+ return "LOOS+0x" + utohexstr(Type - SHT_LOOS);
else if (Type >= SHT_LOPROC && Type <= SHT_HIPROC)
- return "LOPROC+0x" + to_hexString(Type - SHT_LOPROC);
+ return "LOPROC+0x" + utohexstr(Type - SHT_LOPROC);
else if (Type >= SHT_LOUSER && Type <= SHT_HIUSER)
- return "LOUSER+0x" + to_hexString(Type - SHT_LOUSER);
- return "0x" + to_hexString(Type) + ": <unknown>";
+ return "LOUSER+0x" + utohexstr(Type - SHT_LOUSER);
+ return "0x" + utohexstr(Type) + ": <unknown>";
}
static std::string getSectionTypeString(unsigned Machine, unsigned Type) {
ArrayRef<Elf_Shdr> Sections = cantFail(this->Obj.sections());
OS << "There are " << to_string(Sections.size())
<< " section headers, starting at offset "
- << "0x" << to_hexString(this->Obj.getHeader().e_shoff, false) << ":\n\n";
+ << "0x" << utohexstr(this->Obj.getHeader().e_shoff, /*LowerCase=*/true) << ":\n\n";
OS << "Section Headers:\n";
Field Fields[11] = {
{"[Nr]", 2}, {"Name", 7}, {"Type", 25},
Other &= ~STO_AARCH64_VARIANT_PCS;
Fields[5].Str += " [VARIANT_PCS";
if (Other != 0)
- Fields[5].Str.append(" | " + to_hexString(Other, false));
+ Fields[5].Str.append(" | " + utohexstr(Other, /*LowerCase=*/true));
Fields[5].Str.append("]");
}
} else if (this->Obj.getHeader().e_machine == ELF::EM_RISCV) {
Other &= ~STO_RISCV_VARIANT_CC;
Fields[5].Str += " [VARIANT_CC";
if (Other != 0)
- Fields[5].Str.append(" | " + to_hexString(Other, false));
+ Fields[5].Str.append(" | " + utohexstr(Other, /*LowerCase=*/true));
Fields[5].Str.append("]");
}
} else {
ArrayRef<Elf_Shdr> Sections = cantFail(this->Obj.sections());
OS << "There are " << to_string(Sections.size())
<< " section headers, starting at offset "
- << "0x" << to_hexString(this->Obj.getHeader().e_shoff, false) << ":\n\n";
+ << "0x" << utohexstr(this->Obj.getHeader().e_shoff, /*LowerCase=*/true) << ":\n\n";
OS << "Section Headers:\n";
else
TypeStr = "Unknown";
}
- W.printString("Type", TypeStr + " (0x" + to_hexString(E.e_type) + ")");
+ W.printString("Type", TypeStr + " (0x" + utohexstr(E.e_type) + ")");
W.printEnum("Machine", E.e_machine, makeArrayRef(ElfMachineType));
W.printNumber("Version", E.e_version);