From ec895f11cee1e261289cb5320e366d39b9cf806d Mon Sep 17 00:00:00 2001 From: George Rimar Date: Thu, 16 May 2019 06:22:51 +0000 Subject: [PATCH] [llvm-readobj] - Revert r360676 partially. NFC. In the r360676 "Apply clang format. NFC" I applied clang-format for whole ELFDumper.cpp. It caused a little discussion, one of the points mentioned was that previously nicely lined up tables are not so nice now. This patch reverts them. llvm-svn: 360860 --- llvm/tools/llvm-readobj/ELFDumper.cpp | 957 +++++++++++++------------- 1 file changed, 487 insertions(+), 470 deletions(-) diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp index 5ac4db1dc4db..ba6622686b9f 100644 --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -100,7 +100,7 @@ using namespace ELF; using Elf_Word = typename ELFT::Word; \ using Elf_Hash = typename ELFT::Hash; \ using Elf_GnuHash = typename ELFT::GnuHash; \ - using Elf_Note = typename ELFT::Note; \ + using Elf_Note = typename ELFT::Note; \ using Elf_Sym_Range = typename ELFT::SymRange; \ using Elf_Versym = typename ELFT::Versym; \ using Elf_Verneed = typename ELFT::Verneed; \ @@ -231,9 +231,9 @@ private: StringRef DynSymtabName; ArrayRef ShndxTable; - const Elf_Shdr *SymbolVersionSection = nullptr; // .gnu.version + const Elf_Shdr *SymbolVersionSection = nullptr; // .gnu.version const Elf_Shdr *SymbolVersionNeedSection = nullptr; // .gnu.version_r - const Elf_Shdr *SymbolVersionDefSection = nullptr; // .gnu.version_d + const Elf_Shdr *SymbolVersionDefSection = nullptr; // .gnu.version_d // Records for each version index the corresponding Verdef or Vernaux entry. // This is filled the first time LoadVersionMap() is called. @@ -652,8 +652,8 @@ StringRef ELFDumper::getSymbolVersion(StringRef StrTab, // Determine the position in the symbol table of this entry. size_t EntryIndex = (reinterpret_cast(Sym) - - reinterpret_cast(DynSymRegion.Addr)) / - sizeof(Elf_Sym); + reinterpret_cast(DynSymRegion.Addr)) / + sizeof(Elf_Sym); // Get the corresponding version index entry. const Elf_Versym *Versym = @@ -788,44 +788,45 @@ static const typename ELFO::Elf_Shdr *findSectionByName(const ELFO &Obj, } static const EnumEntry ElfClass[] = { - {"None", "none", ELF::ELFCLASSNONE}, - {"32-bit", "ELF32", ELF::ELFCLASS32}, - {"64-bit", "ELF64", ELF::ELFCLASS64}, + {"None", "none", ELF::ELFCLASSNONE}, + {"32-bit", "ELF32", ELF::ELFCLASS32}, + {"64-bit", "ELF64", ELF::ELFCLASS64}, }; static const EnumEntry ElfDataEncoding[] = { - {"None", "none", ELF::ELFDATANONE}, - {"LittleEndian", "2's complement, little endian", ELF::ELFDATA2LSB}, - {"BigEndian", "2's complement, big endian", ELF::ELFDATA2MSB}, + {"None", "none", ELF::ELFDATANONE}, + {"LittleEndian", "2's complement, little endian", ELF::ELFDATA2LSB}, + {"BigEndian", "2's complement, big endian", ELF::ELFDATA2MSB}, }; static const EnumEntry ElfObjectFileType[] = { - {"None", "NONE (none)", ELF::ET_NONE}, - {"Relocatable", "REL (Relocatable file)", ELF::ET_REL}, - {"Executable", "EXEC (Executable file)", ELF::ET_EXEC}, - {"SharedObject", "DYN (Shared object file)", ELF::ET_DYN}, - {"Core", "CORE (Core file)", ELF::ET_CORE}, + {"None", "NONE (none)", ELF::ET_NONE}, + {"Relocatable", "REL (Relocatable file)", ELF::ET_REL}, + {"Executable", "EXEC (Executable file)", ELF::ET_EXEC}, + {"SharedObject", "DYN (Shared object file)", ELF::ET_DYN}, + {"Core", "CORE (Core file)", ELF::ET_CORE}, }; static const EnumEntry ElfOSABI[] = { - {"SystemV", "UNIX - System V", ELF::ELFOSABI_NONE}, - {"HPUX", "UNIX - HP-UX", ELF::ELFOSABI_HPUX}, - {"NetBSD", "UNIX - NetBSD", ELF::ELFOSABI_NETBSD}, - {"GNU/Linux", "UNIX - GNU", ELF::ELFOSABI_LINUX}, - {"GNU/Hurd", "GNU/Hurd", ELF::ELFOSABI_HURD}, - {"Solaris", "UNIX - Solaris", ELF::ELFOSABI_SOLARIS}, - {"AIX", "UNIX - AIX", ELF::ELFOSABI_AIX}, - {"IRIX", "UNIX - IRIX", ELF::ELFOSABI_IRIX}, - {"FreeBSD", "UNIX - FreeBSD", ELF::ELFOSABI_FREEBSD}, - {"TRU64", "UNIX - TRU64", ELF::ELFOSABI_TRU64}, - {"Modesto", "Novell - Modesto", ELF::ELFOSABI_MODESTO}, - {"OpenBSD", "UNIX - OpenBSD", ELF::ELFOSABI_OPENBSD}, - {"OpenVMS", "VMS - OpenVMS", ELF::ELFOSABI_OPENVMS}, - {"NSK", "HP - Non-Stop Kernel", ELF::ELFOSABI_NSK}, - {"AROS", "AROS", ELF::ELFOSABI_AROS}, - {"FenixOS", "FenixOS", ELF::ELFOSABI_FENIXOS}, - {"CloudABI", "CloudABI", ELF::ELFOSABI_CLOUDABI}, - {"Standalone", "Standalone App", ELF::ELFOSABI_STANDALONE}}; + {"SystemV", "UNIX - System V", ELF::ELFOSABI_NONE}, + {"HPUX", "UNIX - HP-UX", ELF::ELFOSABI_HPUX}, + {"NetBSD", "UNIX - NetBSD", ELF::ELFOSABI_NETBSD}, + {"GNU/Linux", "UNIX - GNU", ELF::ELFOSABI_LINUX}, + {"GNU/Hurd", "GNU/Hurd", ELF::ELFOSABI_HURD}, + {"Solaris", "UNIX - Solaris", ELF::ELFOSABI_SOLARIS}, + {"AIX", "UNIX - AIX", ELF::ELFOSABI_AIX}, + {"IRIX", "UNIX - IRIX", ELF::ELFOSABI_IRIX}, + {"FreeBSD", "UNIX - FreeBSD", ELF::ELFOSABI_FREEBSD}, + {"TRU64", "UNIX - TRU64", ELF::ELFOSABI_TRU64}, + {"Modesto", "Novell - Modesto", ELF::ELFOSABI_MODESTO}, + {"OpenBSD", "UNIX - OpenBSD", ELF::ELFOSABI_OPENBSD}, + {"OpenVMS", "VMS - OpenVMS", ELF::ELFOSABI_OPENVMS}, + {"NSK", "HP - Non-Stop Kernel", ELF::ELFOSABI_NSK}, + {"AROS", "AROS", ELF::ELFOSABI_AROS}, + {"FenixOS", "FenixOS", ELF::ELFOSABI_FENIXOS}, + {"CloudABI", "CloudABI", ELF::ELFOSABI_CLOUDABI}, + {"Standalone", "Standalone App", ELF::ELFOSABI_STANDALONE} +}; static const EnumEntry SymVersionFlags[] = { {"Base", "BASE", VER_FLG_BASE}, @@ -833,199 +834,197 @@ static const EnumEntry SymVersionFlags[] = { {"Info", "INFO", VER_FLG_INFO}}; static const EnumEntry AMDGPUElfOSABI[] = { - {"AMDGPU_HSA", "AMDGPU - HSA", ELF::ELFOSABI_AMDGPU_HSA}, - {"AMDGPU_PAL", "AMDGPU - PAL", ELF::ELFOSABI_AMDGPU_PAL}, - {"AMDGPU_MESA3D", "AMDGPU - MESA3D", ELF::ELFOSABI_AMDGPU_MESA3D}}; + {"AMDGPU_HSA", "AMDGPU - HSA", ELF::ELFOSABI_AMDGPU_HSA}, + {"AMDGPU_PAL", "AMDGPU - PAL", ELF::ELFOSABI_AMDGPU_PAL}, + {"AMDGPU_MESA3D", "AMDGPU - MESA3D", ELF::ELFOSABI_AMDGPU_MESA3D} +}; static const EnumEntry ARMElfOSABI[] = { - {"ARM", "ARM", ELF::ELFOSABI_ARM}}; + {"ARM", "ARM", ELF::ELFOSABI_ARM} +}; static const EnumEntry C6000ElfOSABI[] = { - {"C6000_ELFABI", "Bare-metal C6000", ELF::ELFOSABI_C6000_ELFABI}, - {"C6000_LINUX", "Linux C6000", ELF::ELFOSABI_C6000_LINUX}}; + {"C6000_ELFABI", "Bare-metal C6000", ELF::ELFOSABI_C6000_ELFABI}, + {"C6000_LINUX", "Linux C6000", ELF::ELFOSABI_C6000_LINUX} +}; static const EnumEntry ElfMachineType[] = { - ENUM_ENT(EM_NONE, "None"), - ENUM_ENT(EM_M32, "WE32100"), - ENUM_ENT(EM_SPARC, "Sparc"), - ENUM_ENT(EM_386, "Intel 80386"), - ENUM_ENT(EM_68K, "MC68000"), - ENUM_ENT(EM_88K, "MC88000"), - ENUM_ENT(EM_IAMCU, "EM_IAMCU"), - ENUM_ENT(EM_860, "Intel 80860"), - ENUM_ENT(EM_MIPS, "MIPS R3000"), - ENUM_ENT(EM_S370, "IBM System/370"), - ENUM_ENT(EM_MIPS_RS3_LE, "MIPS R3000 little-endian"), - ENUM_ENT(EM_PARISC, "HPPA"), - ENUM_ENT(EM_VPP500, "Fujitsu VPP500"), - ENUM_ENT(EM_SPARC32PLUS, "Sparc v8+"), - ENUM_ENT(EM_960, "Intel 80960"), - ENUM_ENT(EM_PPC, "PowerPC"), - ENUM_ENT(EM_PPC64, "PowerPC64"), - ENUM_ENT(EM_S390, "IBM S/390"), - ENUM_ENT(EM_SPU, "SPU"), - ENUM_ENT(EM_V800, "NEC V800 series"), - ENUM_ENT(EM_FR20, "Fujistsu FR20"), - ENUM_ENT(EM_RH32, "TRW RH-32"), - ENUM_ENT(EM_RCE, "Motorola RCE"), - ENUM_ENT(EM_ARM, "ARM"), - ENUM_ENT(EM_ALPHA, "EM_ALPHA"), - ENUM_ENT(EM_SH, "Hitachi SH"), - ENUM_ENT(EM_SPARCV9, "Sparc v9"), - ENUM_ENT(EM_TRICORE, "Siemens Tricore"), - ENUM_ENT(EM_ARC, "ARC"), - ENUM_ENT(EM_H8_300, "Hitachi H8/300"), - ENUM_ENT(EM_H8_300H, "Hitachi H8/300H"), - ENUM_ENT(EM_H8S, "Hitachi H8S"), - ENUM_ENT(EM_H8_500, "Hitachi H8/500"), - ENUM_ENT(EM_IA_64, "Intel IA-64"), - ENUM_ENT(EM_MIPS_X, "Stanford MIPS-X"), - ENUM_ENT(EM_COLDFIRE, "Motorola Coldfire"), - ENUM_ENT(EM_68HC12, "Motorola MC68HC12 Microcontroller"), - ENUM_ENT(EM_MMA, "Fujitsu Multimedia Accelerator"), - ENUM_ENT(EM_PCP, "Siemens PCP"), - ENUM_ENT(EM_NCPU, "Sony nCPU embedded RISC processor"), - ENUM_ENT(EM_NDR1, "Denso NDR1 microprocesspr"), - ENUM_ENT(EM_STARCORE, "Motorola Star*Core processor"), - ENUM_ENT(EM_ME16, "Toyota ME16 processor"), - ENUM_ENT(EM_ST100, "STMicroelectronics ST100 processor"), - ENUM_ENT(EM_TINYJ, "Advanced Logic Corp. TinyJ embedded processor"), - ENUM_ENT(EM_X86_64, "Advanced Micro Devices X86-64"), - ENUM_ENT(EM_PDSP, "Sony DSP processor"), - ENUM_ENT(EM_PDP10, "Digital Equipment Corp. PDP-10"), - ENUM_ENT(EM_PDP11, "Digital Equipment Corp. PDP-11"), - ENUM_ENT(EM_FX66, "Siemens FX66 microcontroller"), - ENUM_ENT(EM_ST9PLUS, "STMicroelectronics ST9+ 8/16 bit microcontroller"), - ENUM_ENT(EM_ST7, "STMicroelectronics ST7 8-bit microcontroller"), - ENUM_ENT(EM_68HC16, "Motorola MC68HC16 Microcontroller"), - ENUM_ENT(EM_68HC11, "Motorola MC68HC11 Microcontroller"), - ENUM_ENT(EM_68HC08, "Motorola MC68HC08 Microcontroller"), - ENUM_ENT(EM_68HC05, "Motorola MC68HC05 Microcontroller"), - ENUM_ENT(EM_SVX, "Silicon Graphics SVx"), - ENUM_ENT(EM_ST19, "STMicroelectronics ST19 8-bit microcontroller"), - ENUM_ENT(EM_VAX, "Digital VAX"), - ENUM_ENT(EM_CRIS, "Axis Communications 32-bit embedded processor"), - ENUM_ENT(EM_JAVELIN, "Infineon Technologies 32-bit embedded cpu"), - ENUM_ENT(EM_FIREPATH, "Element 14 64-bit DSP processor"), - ENUM_ENT(EM_ZSP, "LSI Logic's 16-bit DSP processor"), - ENUM_ENT(EM_MMIX, "Donald Knuth's educational 64-bit processor"), - ENUM_ENT(EM_HUANY, - "Harvard Universitys's machine-independent object format"), - ENUM_ENT(EM_PRISM, "Vitesse Prism"), - ENUM_ENT(EM_AVR, "Atmel AVR 8-bit microcontroller"), - ENUM_ENT(EM_FR30, "Fujitsu FR30"), - ENUM_ENT(EM_D10V, "Mitsubishi D10V"), - ENUM_ENT(EM_D30V, "Mitsubishi D30V"), - ENUM_ENT(EM_V850, "NEC v850"), - ENUM_ENT(EM_M32R, "Renesas M32R (formerly Mitsubishi M32r)"), - ENUM_ENT(EM_MN10300, "Matsushita MN10300"), - ENUM_ENT(EM_MN10200, "Matsushita MN10200"), - ENUM_ENT(EM_PJ, "picoJava"), - ENUM_ENT(EM_OPENRISC, "OpenRISC 32-bit embedded processor"), - ENUM_ENT(EM_ARC_COMPACT, "EM_ARC_COMPACT"), - ENUM_ENT(EM_XTENSA, "Tensilica Xtensa Processor"), - ENUM_ENT(EM_VIDEOCORE, "Alphamosaic VideoCore processor"), - ENUM_ENT(EM_TMM_GPP, "Thompson Multimedia General Purpose Processor"), - ENUM_ENT(EM_NS32K, "National Semiconductor 32000 series"), - ENUM_ENT(EM_TPC, "Tenor Network TPC processor"), - ENUM_ENT(EM_SNP1K, "EM_SNP1K"), - ENUM_ENT(EM_ST200, "STMicroelectronics ST200 microcontroller"), - ENUM_ENT(EM_IP2K, "Ubicom IP2xxx 8-bit microcontrollers"), - ENUM_ENT(EM_MAX, "MAX Processor"), - ENUM_ENT(EM_CR, "National Semiconductor CompactRISC"), - ENUM_ENT(EM_F2MC16, "Fujitsu F2MC16"), - ENUM_ENT(EM_MSP430, "Texas Instruments msp430 microcontroller"), - ENUM_ENT(EM_BLACKFIN, "Analog Devices Blackfin"), - ENUM_ENT(EM_SE_C33, "S1C33 Family of Seiko Epson processors"), - ENUM_ENT(EM_SEP, "Sharp embedded microprocessor"), - ENUM_ENT(EM_ARCA, "Arca RISC microprocessor"), - ENUM_ENT(EM_UNICORE, "Unicore"), - ENUM_ENT(EM_EXCESS, "eXcess 16/32/64-bit configurable embedded CPU"), - ENUM_ENT(EM_DXP, "Icera Semiconductor Inc. Deep Execution Processor"), - ENUM_ENT(EM_ALTERA_NIOS2, "Altera Nios"), - ENUM_ENT(EM_CRX, "National Semiconductor CRX microprocessor"), - ENUM_ENT(EM_XGATE, "Motorola XGATE embedded processor"), - ENUM_ENT(EM_C166, "Infineon Technologies xc16x"), - ENUM_ENT(EM_M16C, "Renesas M16C"), - ENUM_ENT(EM_DSPIC30F, - "Microchip Technology dsPIC30F Digital Signal Controller"), - ENUM_ENT(EM_CE, "Freescale Communication Engine RISC core"), - ENUM_ENT(EM_M32C, "Renesas M32C"), - ENUM_ENT(EM_TSK3000, "Altium TSK3000 core"), - ENUM_ENT(EM_RS08, "Freescale RS08 embedded processor"), - ENUM_ENT(EM_SHARC, "EM_SHARC"), - ENUM_ENT(EM_ECOG2, "Cyan Technology eCOG2 microprocessor"), - ENUM_ENT(EM_SCORE7, "SUNPLUS S+Core"), - ENUM_ENT(EM_DSP24, "New Japan Radio (NJR) 24-bit DSP Processor"), - ENUM_ENT(EM_VIDEOCORE3, "Broadcom VideoCore III processor"), - ENUM_ENT(EM_LATTICEMICO32, "Lattice Mico32"), - ENUM_ENT(EM_SE_C17, "Seiko Epson C17 family"), - ENUM_ENT(EM_TI_C6000, "Texas Instruments TMS320C6000 DSP family"), - ENUM_ENT(EM_TI_C2000, "Texas Instruments TMS320C2000 DSP family"), - ENUM_ENT(EM_TI_C5500, "Texas Instruments TMS320C55x DSP family"), - ENUM_ENT(EM_MMDSP_PLUS, - "STMicroelectronics 64bit VLIW Data Signal Processor"), - ENUM_ENT(EM_CYPRESS_M8C, "Cypress M8C microprocessor"), - ENUM_ENT(EM_R32C, "Renesas R32C series microprocessors"), - ENUM_ENT(EM_TRIMEDIA, "NXP Semiconductors TriMedia architecture family"), - ENUM_ENT(EM_HEXAGON, "Qualcomm Hexagon"), - ENUM_ENT(EM_8051, "Intel 8051 and variants"), - ENUM_ENT(EM_STXP7X, "STMicroelectronics STxP7x family"), - ENUM_ENT( - EM_NDS32, - "Andes Technology compact code size embedded RISC processor family"), - ENUM_ENT(EM_ECOG1, "Cyan Technology eCOG1 microprocessor"), - ENUM_ENT(EM_ECOG1X, "Cyan Technology eCOG1X family"), - ENUM_ENT(EM_MAXQ30, "Dallas Semiconductor MAXQ30 Core microcontrollers"), - ENUM_ENT(EM_XIMO16, "New Japan Radio (NJR) 16-bit DSP Processor"), - ENUM_ENT(EM_MANIK, "M2000 Reconfigurable RISC Microprocessor"), - ENUM_ENT(EM_CRAYNV2, "Cray Inc. NV2 vector architecture"), - ENUM_ENT(EM_RX, "Renesas RX"), - ENUM_ENT(EM_METAG, "Imagination Technologies Meta processor architecture"), - ENUM_ENT(EM_MCST_ELBRUS, - "MCST Elbrus general purpose hardware architecture"), - ENUM_ENT(EM_ECOG16, "Cyan Technology eCOG16 family"), - ENUM_ENT(EM_CR16, "Xilinx MicroBlaze"), - ENUM_ENT(EM_ETPU, "Freescale Extended Time Processing Unit"), - ENUM_ENT(EM_SLE9X, "Infineon Technologies SLE9X core"), - ENUM_ENT(EM_L10M, "EM_L10M"), - ENUM_ENT(EM_K10M, "EM_K10M"), - ENUM_ENT(EM_AARCH64, "AArch64"), - ENUM_ENT(EM_AVR32, "Atmel Corporation 32-bit microprocessor family"), - ENUM_ENT(EM_STM8, "STMicroeletronics STM8 8-bit microcontroller"), - ENUM_ENT(EM_TILE64, "Tilera TILE64 multicore architecture family"), - ENUM_ENT(EM_TILEPRO, "Tilera TILEPro multicore architecture family"), - ENUM_ENT(EM_CUDA, "NVIDIA CUDA architecture"), - ENUM_ENT(EM_TILEGX, "Tilera TILE-Gx multicore architecture family"), - ENUM_ENT(EM_CLOUDSHIELD, "EM_CLOUDSHIELD"), - ENUM_ENT(EM_COREA_1ST, "EM_COREA_1ST"), - ENUM_ENT(EM_COREA_2ND, "EM_COREA_2ND"), - ENUM_ENT(EM_ARC_COMPACT2, "EM_ARC_COMPACT2"), - ENUM_ENT(EM_OPEN8, "EM_OPEN8"), - ENUM_ENT(EM_RL78, "Renesas RL78"), - ENUM_ENT(EM_VIDEOCORE5, "Broadcom VideoCore V processor"), - ENUM_ENT(EM_78KOR, "EM_78KOR"), - ENUM_ENT(EM_56800EX, "EM_56800EX"), - ENUM_ENT(EM_AMDGPU, "EM_AMDGPU"), - ENUM_ENT(EM_RISCV, "RISC-V"), - ENUM_ENT(EM_LANAI, "EM_LANAI"), - ENUM_ENT(EM_BPF, "EM_BPF"), + ENUM_ENT(EM_NONE, "None"), + ENUM_ENT(EM_M32, "WE32100"), + ENUM_ENT(EM_SPARC, "Sparc"), + ENUM_ENT(EM_386, "Intel 80386"), + ENUM_ENT(EM_68K, "MC68000"), + ENUM_ENT(EM_88K, "MC88000"), + ENUM_ENT(EM_IAMCU, "EM_IAMCU"), + ENUM_ENT(EM_860, "Intel 80860"), + ENUM_ENT(EM_MIPS, "MIPS R3000"), + ENUM_ENT(EM_S370, "IBM System/370"), + ENUM_ENT(EM_MIPS_RS3_LE, "MIPS R3000 little-endian"), + ENUM_ENT(EM_PARISC, "HPPA"), + ENUM_ENT(EM_VPP500, "Fujitsu VPP500"), + ENUM_ENT(EM_SPARC32PLUS, "Sparc v8+"), + ENUM_ENT(EM_960, "Intel 80960"), + ENUM_ENT(EM_PPC, "PowerPC"), + ENUM_ENT(EM_PPC64, "PowerPC64"), + ENUM_ENT(EM_S390, "IBM S/390"), + ENUM_ENT(EM_SPU, "SPU"), + ENUM_ENT(EM_V800, "NEC V800 series"), + ENUM_ENT(EM_FR20, "Fujistsu FR20"), + ENUM_ENT(EM_RH32, "TRW RH-32"), + ENUM_ENT(EM_RCE, "Motorola RCE"), + ENUM_ENT(EM_ARM, "ARM"), + ENUM_ENT(EM_ALPHA, "EM_ALPHA"), + ENUM_ENT(EM_SH, "Hitachi SH"), + ENUM_ENT(EM_SPARCV9, "Sparc v9"), + ENUM_ENT(EM_TRICORE, "Siemens Tricore"), + ENUM_ENT(EM_ARC, "ARC"), + ENUM_ENT(EM_H8_300, "Hitachi H8/300"), + ENUM_ENT(EM_H8_300H, "Hitachi H8/300H"), + ENUM_ENT(EM_H8S, "Hitachi H8S"), + ENUM_ENT(EM_H8_500, "Hitachi H8/500"), + ENUM_ENT(EM_IA_64, "Intel IA-64"), + ENUM_ENT(EM_MIPS_X, "Stanford MIPS-X"), + ENUM_ENT(EM_COLDFIRE, "Motorola Coldfire"), + ENUM_ENT(EM_68HC12, "Motorola MC68HC12 Microcontroller"), + ENUM_ENT(EM_MMA, "Fujitsu Multimedia Accelerator"), + ENUM_ENT(EM_PCP, "Siemens PCP"), + ENUM_ENT(EM_NCPU, "Sony nCPU embedded RISC processor"), + ENUM_ENT(EM_NDR1, "Denso NDR1 microprocesspr"), + ENUM_ENT(EM_STARCORE, "Motorola Star*Core processor"), + ENUM_ENT(EM_ME16, "Toyota ME16 processor"), + ENUM_ENT(EM_ST100, "STMicroelectronics ST100 processor"), + ENUM_ENT(EM_TINYJ, "Advanced Logic Corp. TinyJ embedded processor"), + ENUM_ENT(EM_X86_64, "Advanced Micro Devices X86-64"), + ENUM_ENT(EM_PDSP, "Sony DSP processor"), + ENUM_ENT(EM_PDP10, "Digital Equipment Corp. PDP-10"), + ENUM_ENT(EM_PDP11, "Digital Equipment Corp. PDP-11"), + ENUM_ENT(EM_FX66, "Siemens FX66 microcontroller"), + ENUM_ENT(EM_ST9PLUS, "STMicroelectronics ST9+ 8/16 bit microcontroller"), + ENUM_ENT(EM_ST7, "STMicroelectronics ST7 8-bit microcontroller"), + ENUM_ENT(EM_68HC16, "Motorola MC68HC16 Microcontroller"), + ENUM_ENT(EM_68HC11, "Motorola MC68HC11 Microcontroller"), + ENUM_ENT(EM_68HC08, "Motorola MC68HC08 Microcontroller"), + ENUM_ENT(EM_68HC05, "Motorola MC68HC05 Microcontroller"), + ENUM_ENT(EM_SVX, "Silicon Graphics SVx"), + ENUM_ENT(EM_ST19, "STMicroelectronics ST19 8-bit microcontroller"), + ENUM_ENT(EM_VAX, "Digital VAX"), + ENUM_ENT(EM_CRIS, "Axis Communications 32-bit embedded processor"), + ENUM_ENT(EM_JAVELIN, "Infineon Technologies 32-bit embedded cpu"), + ENUM_ENT(EM_FIREPATH, "Element 14 64-bit DSP processor"), + ENUM_ENT(EM_ZSP, "LSI Logic's 16-bit DSP processor"), + ENUM_ENT(EM_MMIX, "Donald Knuth's educational 64-bit processor"), + ENUM_ENT(EM_HUANY, "Harvard Universitys's machine-independent object format"), + ENUM_ENT(EM_PRISM, "Vitesse Prism"), + ENUM_ENT(EM_AVR, "Atmel AVR 8-bit microcontroller"), + ENUM_ENT(EM_FR30, "Fujitsu FR30"), + ENUM_ENT(EM_D10V, "Mitsubishi D10V"), + ENUM_ENT(EM_D30V, "Mitsubishi D30V"), + ENUM_ENT(EM_V850, "NEC v850"), + ENUM_ENT(EM_M32R, "Renesas M32R (formerly Mitsubishi M32r)"), + ENUM_ENT(EM_MN10300, "Matsushita MN10300"), + ENUM_ENT(EM_MN10200, "Matsushita MN10200"), + ENUM_ENT(EM_PJ, "picoJava"), + ENUM_ENT(EM_OPENRISC, "OpenRISC 32-bit embedded processor"), + ENUM_ENT(EM_ARC_COMPACT, "EM_ARC_COMPACT"), + ENUM_ENT(EM_XTENSA, "Tensilica Xtensa Processor"), + ENUM_ENT(EM_VIDEOCORE, "Alphamosaic VideoCore processor"), + ENUM_ENT(EM_TMM_GPP, "Thompson Multimedia General Purpose Processor"), + ENUM_ENT(EM_NS32K, "National Semiconductor 32000 series"), + ENUM_ENT(EM_TPC, "Tenor Network TPC processor"), + ENUM_ENT(EM_SNP1K, "EM_SNP1K"), + ENUM_ENT(EM_ST200, "STMicroelectronics ST200 microcontroller"), + ENUM_ENT(EM_IP2K, "Ubicom IP2xxx 8-bit microcontrollers"), + ENUM_ENT(EM_MAX, "MAX Processor"), + ENUM_ENT(EM_CR, "National Semiconductor CompactRISC"), + ENUM_ENT(EM_F2MC16, "Fujitsu F2MC16"), + ENUM_ENT(EM_MSP430, "Texas Instruments msp430 microcontroller"), + ENUM_ENT(EM_BLACKFIN, "Analog Devices Blackfin"), + ENUM_ENT(EM_SE_C33, "S1C33 Family of Seiko Epson processors"), + ENUM_ENT(EM_SEP, "Sharp embedded microprocessor"), + ENUM_ENT(EM_ARCA, "Arca RISC microprocessor"), + ENUM_ENT(EM_UNICORE, "Unicore"), + ENUM_ENT(EM_EXCESS, "eXcess 16/32/64-bit configurable embedded CPU"), + ENUM_ENT(EM_DXP, "Icera Semiconductor Inc. Deep Execution Processor"), + ENUM_ENT(EM_ALTERA_NIOS2, "Altera Nios"), + ENUM_ENT(EM_CRX, "National Semiconductor CRX microprocessor"), + ENUM_ENT(EM_XGATE, "Motorola XGATE embedded processor"), + ENUM_ENT(EM_C166, "Infineon Technologies xc16x"), + ENUM_ENT(EM_M16C, "Renesas M16C"), + ENUM_ENT(EM_DSPIC30F, "Microchip Technology dsPIC30F Digital Signal Controller"), + ENUM_ENT(EM_CE, "Freescale Communication Engine RISC core"), + ENUM_ENT(EM_M32C, "Renesas M32C"), + ENUM_ENT(EM_TSK3000, "Altium TSK3000 core"), + ENUM_ENT(EM_RS08, "Freescale RS08 embedded processor"), + ENUM_ENT(EM_SHARC, "EM_SHARC"), + ENUM_ENT(EM_ECOG2, "Cyan Technology eCOG2 microprocessor"), + ENUM_ENT(EM_SCORE7, "SUNPLUS S+Core"), + ENUM_ENT(EM_DSP24, "New Japan Radio (NJR) 24-bit DSP Processor"), + ENUM_ENT(EM_VIDEOCORE3, "Broadcom VideoCore III processor"), + ENUM_ENT(EM_LATTICEMICO32, "Lattice Mico32"), + ENUM_ENT(EM_SE_C17, "Seiko Epson C17 family"), + ENUM_ENT(EM_TI_C6000, "Texas Instruments TMS320C6000 DSP family"), + ENUM_ENT(EM_TI_C2000, "Texas Instruments TMS320C2000 DSP family"), + ENUM_ENT(EM_TI_C5500, "Texas Instruments TMS320C55x DSP family"), + ENUM_ENT(EM_MMDSP_PLUS, "STMicroelectronics 64bit VLIW Data Signal Processor"), + ENUM_ENT(EM_CYPRESS_M8C, "Cypress M8C microprocessor"), + ENUM_ENT(EM_R32C, "Renesas R32C series microprocessors"), + ENUM_ENT(EM_TRIMEDIA, "NXP Semiconductors TriMedia architecture family"), + ENUM_ENT(EM_HEXAGON, "Qualcomm Hexagon"), + ENUM_ENT(EM_8051, "Intel 8051 and variants"), + ENUM_ENT(EM_STXP7X, "STMicroelectronics STxP7x family"), + ENUM_ENT(EM_NDS32, "Andes Technology compact code size embedded RISC processor family"), + ENUM_ENT(EM_ECOG1, "Cyan Technology eCOG1 microprocessor"), + ENUM_ENT(EM_ECOG1X, "Cyan Technology eCOG1X family"), + ENUM_ENT(EM_MAXQ30, "Dallas Semiconductor MAXQ30 Core microcontrollers"), + ENUM_ENT(EM_XIMO16, "New Japan Radio (NJR) 16-bit DSP Processor"), + ENUM_ENT(EM_MANIK, "M2000 Reconfigurable RISC Microprocessor"), + ENUM_ENT(EM_CRAYNV2, "Cray Inc. NV2 vector architecture"), + ENUM_ENT(EM_RX, "Renesas RX"), + ENUM_ENT(EM_METAG, "Imagination Technologies Meta processor architecture"), + ENUM_ENT(EM_MCST_ELBRUS, "MCST Elbrus general purpose hardware architecture"), + ENUM_ENT(EM_ECOG16, "Cyan Technology eCOG16 family"), + ENUM_ENT(EM_CR16, "Xilinx MicroBlaze"), + ENUM_ENT(EM_ETPU, "Freescale Extended Time Processing Unit"), + ENUM_ENT(EM_SLE9X, "Infineon Technologies SLE9X core"), + ENUM_ENT(EM_L10M, "EM_L10M"), + ENUM_ENT(EM_K10M, "EM_K10M"), + ENUM_ENT(EM_AARCH64, "AArch64"), + ENUM_ENT(EM_AVR32, "Atmel Corporation 32-bit microprocessor family"), + ENUM_ENT(EM_STM8, "STMicroeletronics STM8 8-bit microcontroller"), + ENUM_ENT(EM_TILE64, "Tilera TILE64 multicore architecture family"), + ENUM_ENT(EM_TILEPRO, "Tilera TILEPro multicore architecture family"), + ENUM_ENT(EM_CUDA, "NVIDIA CUDA architecture"), + ENUM_ENT(EM_TILEGX, "Tilera TILE-Gx multicore architecture family"), + ENUM_ENT(EM_CLOUDSHIELD, "EM_CLOUDSHIELD"), + ENUM_ENT(EM_COREA_1ST, "EM_COREA_1ST"), + ENUM_ENT(EM_COREA_2ND, "EM_COREA_2ND"), + ENUM_ENT(EM_ARC_COMPACT2, "EM_ARC_COMPACT2"), + ENUM_ENT(EM_OPEN8, "EM_OPEN8"), + ENUM_ENT(EM_RL78, "Renesas RL78"), + ENUM_ENT(EM_VIDEOCORE5, "Broadcom VideoCore V processor"), + ENUM_ENT(EM_78KOR, "EM_78KOR"), + ENUM_ENT(EM_56800EX, "EM_56800EX"), + ENUM_ENT(EM_AMDGPU, "EM_AMDGPU"), + ENUM_ENT(EM_RISCV, "RISC-V"), + ENUM_ENT(EM_LANAI, "EM_LANAI"), + ENUM_ENT(EM_BPF, "EM_BPF"), }; static const EnumEntry ElfSymbolBindings[] = { - {"Local", "LOCAL", ELF::STB_LOCAL}, + {"Local", "LOCAL", ELF::STB_LOCAL}, {"Global", "GLOBAL", ELF::STB_GLOBAL}, - {"Weak", "WEAK", ELF::STB_WEAK}, + {"Weak", "WEAK", ELF::STB_WEAK}, {"Unique", "UNIQUE", ELF::STB_GNU_UNIQUE}}; static const EnumEntry ElfSymbolVisibilities[] = { - {"DEFAULT", "DEFAULT", ELF::STV_DEFAULT}, - {"INTERNAL", "INTERNAL", ELF::STV_INTERNAL}, - {"HIDDEN", "HIDDEN", ELF::STV_HIDDEN}, + {"DEFAULT", "DEFAULT", ELF::STV_DEFAULT}, + {"INTERNAL", "INTERNAL", ELF::STV_INTERNAL}, + {"HIDDEN", "HIDDEN", ELF::STV_HIDDEN}, {"PROTECTED", "PROTECTED", ELF::STV_PROTECTED}}; static const EnumEntry AMDGPUSymbolTypes[] = { - {"AMDGPU_HSA_KERNEL", ELF::STT_AMDGPU_HSA_KERNEL}}; + { "AMDGPU_HSA_KERNEL", ELF::STT_AMDGPU_HSA_KERNEL } +}; static const char *getGroupType(uint32_t Flag) { if (Flag & ELF::GRP_COMDAT) @@ -1035,44 +1034,49 @@ static const char *getGroupType(uint32_t Flag) { } static const EnumEntry ElfSectionFlags[] = { - ENUM_ENT(SHF_WRITE, "W"), - ENUM_ENT(SHF_ALLOC, "A"), - ENUM_ENT(SHF_EXCLUDE, "E"), - ENUM_ENT(SHF_EXECINSTR, "X"), - ENUM_ENT(SHF_MERGE, "M"), - ENUM_ENT(SHF_STRINGS, "S"), - ENUM_ENT(SHF_INFO_LINK, "I"), - ENUM_ENT(SHF_LINK_ORDER, "L"), - ENUM_ENT(SHF_OS_NONCONFORMING, "o"), - ENUM_ENT(SHF_GROUP, "G"), - ENUM_ENT(SHF_TLS, "T"), - ENUM_ENT(SHF_MASKOS, "o"), - ENUM_ENT(SHF_MASKPROC, "p"), - ENUM_ENT_1(SHF_COMPRESSED), + ENUM_ENT(SHF_WRITE, "W"), + ENUM_ENT(SHF_ALLOC, "A"), + ENUM_ENT(SHF_EXCLUDE, "E"), + ENUM_ENT(SHF_EXECINSTR, "X"), + ENUM_ENT(SHF_MERGE, "M"), + ENUM_ENT(SHF_STRINGS, "S"), + ENUM_ENT(SHF_INFO_LINK, "I"), + ENUM_ENT(SHF_LINK_ORDER, "L"), + ENUM_ENT(SHF_OS_NONCONFORMING, "o"), + ENUM_ENT(SHF_GROUP, "G"), + ENUM_ENT(SHF_TLS, "T"), + ENUM_ENT(SHF_MASKOS, "o"), + ENUM_ENT(SHF_MASKPROC, "p"), + ENUM_ENT_1(SHF_COMPRESSED), }; static const EnumEntry ElfXCoreSectionFlags[] = { - LLVM_READOBJ_ENUM_ENT(ELF, XCORE_SHF_CP_SECTION), - LLVM_READOBJ_ENUM_ENT(ELF, XCORE_SHF_DP_SECTION)}; + LLVM_READOBJ_ENUM_ENT(ELF, XCORE_SHF_CP_SECTION), + LLVM_READOBJ_ENUM_ENT(ELF, XCORE_SHF_DP_SECTION) +}; static const EnumEntry ElfARMSectionFlags[] = { - LLVM_READOBJ_ENUM_ENT(ELF, SHF_ARM_PURECODE)}; + LLVM_READOBJ_ENUM_ENT(ELF, SHF_ARM_PURECODE) +}; static const EnumEntry ElfHexagonSectionFlags[] = { - LLVM_READOBJ_ENUM_ENT(ELF, SHF_HEX_GPREL)}; + LLVM_READOBJ_ENUM_ENT(ELF, SHF_HEX_GPREL) +}; static const EnumEntry ElfMipsSectionFlags[] = { - LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_NODUPES), - LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_NAMES), - LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_LOCAL), - LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_NOSTRIP), - LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_GPREL), - LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_MERGE), - LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_ADDR), - LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_STRING)}; + LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_NODUPES), + LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_NAMES ), + LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_LOCAL ), + LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_NOSTRIP), + LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_GPREL ), + LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_MERGE ), + LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_ADDR ), + LLVM_READOBJ_ENUM_ENT(ELF, SHF_MIPS_STRING ) +}; static const EnumEntry ElfX86_64SectionFlags[] = { - LLVM_READOBJ_ENUM_ENT(ELF, SHF_X86_64_LARGE)}; + LLVM_READOBJ_ENUM_ENT(ELF, SHF_X86_64_LARGE) +}; static std::string getGNUFlags(uint64_t Flags) { std::string Str; @@ -1116,25 +1120,25 @@ static const char *getElfSegmentType(unsigned Arch, unsigned Type) { case ELF::EM_MIPS_RS3_LE: switch (Type) { LLVM_READOBJ_ENUM_CASE(ELF, PT_MIPS_REGINFO); - LLVM_READOBJ_ENUM_CASE(ELF, PT_MIPS_RTPROC); - LLVM_READOBJ_ENUM_CASE(ELF, PT_MIPS_OPTIONS); - LLVM_READOBJ_ENUM_CASE(ELF, PT_MIPS_ABIFLAGS); + LLVM_READOBJ_ENUM_CASE(ELF, PT_MIPS_RTPROC); + LLVM_READOBJ_ENUM_CASE(ELF, PT_MIPS_OPTIONS); + LLVM_READOBJ_ENUM_CASE(ELF, PT_MIPS_ABIFLAGS); } break; } switch (Type) { - LLVM_READOBJ_ENUM_CASE(ELF, PT_NULL); - LLVM_READOBJ_ENUM_CASE(ELF, PT_LOAD); - LLVM_READOBJ_ENUM_CASE(ELF, PT_DYNAMIC); - LLVM_READOBJ_ENUM_CASE(ELF, PT_INTERP); - LLVM_READOBJ_ENUM_CASE(ELF, PT_NOTE); - LLVM_READOBJ_ENUM_CASE(ELF, PT_SHLIB); - LLVM_READOBJ_ENUM_CASE(ELF, PT_PHDR); - LLVM_READOBJ_ENUM_CASE(ELF, PT_TLS); + LLVM_READOBJ_ENUM_CASE(ELF, PT_NULL ); + LLVM_READOBJ_ENUM_CASE(ELF, PT_LOAD ); + LLVM_READOBJ_ENUM_CASE(ELF, PT_DYNAMIC); + LLVM_READOBJ_ENUM_CASE(ELF, PT_INTERP ); + LLVM_READOBJ_ENUM_CASE(ELF, PT_NOTE ); + LLVM_READOBJ_ENUM_CASE(ELF, PT_SHLIB ); + LLVM_READOBJ_ENUM_CASE(ELF, PT_PHDR ); + LLVM_READOBJ_ENUM_CASE(ELF, PT_TLS ); - LLVM_READOBJ_ENUM_CASE(ELF, PT_GNU_EH_FRAME); - LLVM_READOBJ_ENUM_CASE(ELF, PT_SUNW_UNWIND); + LLVM_READOBJ_ENUM_CASE(ELF, PT_GNU_EH_FRAME); + LLVM_READOBJ_ENUM_CASE(ELF, PT_SUNW_UNWIND); LLVM_READOBJ_ENUM_CASE(ELF, PT_GNU_STACK); LLVM_READOBJ_ENUM_CASE(ELF, PT_GNU_RELRO); @@ -1188,129 +1192,137 @@ static std::string getElfPtType(unsigned Arch, unsigned Type) { } static const EnumEntry ElfSegmentFlags[] = { - LLVM_READOBJ_ENUM_ENT(ELF, PF_X), LLVM_READOBJ_ENUM_ENT(ELF, PF_W), - LLVM_READOBJ_ENUM_ENT(ELF, PF_R)}; + LLVM_READOBJ_ENUM_ENT(ELF, PF_X), + LLVM_READOBJ_ENUM_ENT(ELF, PF_W), + LLVM_READOBJ_ENUM_ENT(ELF, PF_R) +}; static const EnumEntry ElfHeaderMipsFlags[] = { - ENUM_ENT(EF_MIPS_NOREORDER, "noreorder"), - ENUM_ENT(EF_MIPS_PIC, "pic"), - ENUM_ENT(EF_MIPS_CPIC, "cpic"), - ENUM_ENT(EF_MIPS_ABI2, "abi2"), - ENUM_ENT(EF_MIPS_32BITMODE, "32bitmode"), - ENUM_ENT(EF_MIPS_FP64, "fp64"), - ENUM_ENT(EF_MIPS_NAN2008, "nan2008"), - ENUM_ENT(EF_MIPS_ABI_O32, "o32"), - ENUM_ENT(EF_MIPS_ABI_O64, "o64"), - ENUM_ENT(EF_MIPS_ABI_EABI32, "eabi32"), - ENUM_ENT(EF_MIPS_ABI_EABI64, "eabi64"), - ENUM_ENT(EF_MIPS_MACH_3900, "3900"), - ENUM_ENT(EF_MIPS_MACH_4010, "4010"), - ENUM_ENT(EF_MIPS_MACH_4100, "4100"), - ENUM_ENT(EF_MIPS_MACH_4650, "4650"), - ENUM_ENT(EF_MIPS_MACH_4120, "4120"), - ENUM_ENT(EF_MIPS_MACH_4111, "4111"), - ENUM_ENT(EF_MIPS_MACH_SB1, "sb1"), - ENUM_ENT(EF_MIPS_MACH_OCTEON, "octeon"), - ENUM_ENT(EF_MIPS_MACH_XLR, "xlr"), - ENUM_ENT(EF_MIPS_MACH_OCTEON2, "octeon2"), - ENUM_ENT(EF_MIPS_MACH_OCTEON3, "octeon3"), - ENUM_ENT(EF_MIPS_MACH_5400, "5400"), - ENUM_ENT(EF_MIPS_MACH_5900, "5900"), - ENUM_ENT(EF_MIPS_MACH_5500, "5500"), - ENUM_ENT(EF_MIPS_MACH_9000, "9000"), - ENUM_ENT(EF_MIPS_MACH_LS2E, "loongson-2e"), - ENUM_ENT(EF_MIPS_MACH_LS2F, "loongson-2f"), - ENUM_ENT(EF_MIPS_MACH_LS3A, "loongson-3a"), - ENUM_ENT(EF_MIPS_MICROMIPS, "micromips"), - ENUM_ENT(EF_MIPS_ARCH_ASE_M16, "mips16"), - ENUM_ENT(EF_MIPS_ARCH_ASE_MDMX, "mdmx"), - ENUM_ENT(EF_MIPS_ARCH_1, "mips1"), - ENUM_ENT(EF_MIPS_ARCH_2, "mips2"), - ENUM_ENT(EF_MIPS_ARCH_3, "mips3"), - ENUM_ENT(EF_MIPS_ARCH_4, "mips4"), - ENUM_ENT(EF_MIPS_ARCH_5, "mips5"), - ENUM_ENT(EF_MIPS_ARCH_32, "mips32"), - ENUM_ENT(EF_MIPS_ARCH_64, "mips64"), - ENUM_ENT(EF_MIPS_ARCH_32R2, "mips32r2"), - ENUM_ENT(EF_MIPS_ARCH_64R2, "mips64r2"), - ENUM_ENT(EF_MIPS_ARCH_32R6, "mips32r6"), - ENUM_ENT(EF_MIPS_ARCH_64R6, "mips64r6")}; + ENUM_ENT(EF_MIPS_NOREORDER, "noreorder"), + ENUM_ENT(EF_MIPS_PIC, "pic"), + ENUM_ENT(EF_MIPS_CPIC, "cpic"), + ENUM_ENT(EF_MIPS_ABI2, "abi2"), + ENUM_ENT(EF_MIPS_32BITMODE, "32bitmode"), + ENUM_ENT(EF_MIPS_FP64, "fp64"), + ENUM_ENT(EF_MIPS_NAN2008, "nan2008"), + ENUM_ENT(EF_MIPS_ABI_O32, "o32"), + ENUM_ENT(EF_MIPS_ABI_O64, "o64"), + ENUM_ENT(EF_MIPS_ABI_EABI32, "eabi32"), + ENUM_ENT(EF_MIPS_ABI_EABI64, "eabi64"), + ENUM_ENT(EF_MIPS_MACH_3900, "3900"), + ENUM_ENT(EF_MIPS_MACH_4010, "4010"), + ENUM_ENT(EF_MIPS_MACH_4100, "4100"), + ENUM_ENT(EF_MIPS_MACH_4650, "4650"), + ENUM_ENT(EF_MIPS_MACH_4120, "4120"), + ENUM_ENT(EF_MIPS_MACH_4111, "4111"), + ENUM_ENT(EF_MIPS_MACH_SB1, "sb1"), + ENUM_ENT(EF_MIPS_MACH_OCTEON, "octeon"), + ENUM_ENT(EF_MIPS_MACH_XLR, "xlr"), + ENUM_ENT(EF_MIPS_MACH_OCTEON2, "octeon2"), + ENUM_ENT(EF_MIPS_MACH_OCTEON3, "octeon3"), + ENUM_ENT(EF_MIPS_MACH_5400, "5400"), + ENUM_ENT(EF_MIPS_MACH_5900, "5900"), + ENUM_ENT(EF_MIPS_MACH_5500, "5500"), + ENUM_ENT(EF_MIPS_MACH_9000, "9000"), + ENUM_ENT(EF_MIPS_MACH_LS2E, "loongson-2e"), + ENUM_ENT(EF_MIPS_MACH_LS2F, "loongson-2f"), + ENUM_ENT(EF_MIPS_MACH_LS3A, "loongson-3a"), + ENUM_ENT(EF_MIPS_MICROMIPS, "micromips"), + ENUM_ENT(EF_MIPS_ARCH_ASE_M16, "mips16"), + ENUM_ENT(EF_MIPS_ARCH_ASE_MDMX, "mdmx"), + ENUM_ENT(EF_MIPS_ARCH_1, "mips1"), + ENUM_ENT(EF_MIPS_ARCH_2, "mips2"), + ENUM_ENT(EF_MIPS_ARCH_3, "mips3"), + ENUM_ENT(EF_MIPS_ARCH_4, "mips4"), + ENUM_ENT(EF_MIPS_ARCH_5, "mips5"), + ENUM_ENT(EF_MIPS_ARCH_32, "mips32"), + ENUM_ENT(EF_MIPS_ARCH_64, "mips64"), + ENUM_ENT(EF_MIPS_ARCH_32R2, "mips32r2"), + ENUM_ENT(EF_MIPS_ARCH_64R2, "mips64r2"), + ENUM_ENT(EF_MIPS_ARCH_32R6, "mips32r6"), + ENUM_ENT(EF_MIPS_ARCH_64R6, "mips64r6") +}; static const EnumEntry ElfHeaderAMDGPUFlags[] = { - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_NONE), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_R600), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_R630), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_RS880), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_RV670), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_RV710), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_RV730), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_RV770), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_CEDAR), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_CYPRESS), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_JUNIPER), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_REDWOOD), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_SUMO), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_BARTS), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_CAICOS), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_CAYMAN), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_TURKS), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX600), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX601), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX700), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX701), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX702), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX703), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX704), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX801), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX802), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX803), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX810), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX900), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX902), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX904), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX906), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX909), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX1010), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_XNACK), - LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_SRAM_ECC)}; + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_NONE), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_R600), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_R630), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_RS880), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_RV670), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_RV710), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_RV730), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_RV770), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_CEDAR), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_CYPRESS), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_JUNIPER), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_REDWOOD), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_SUMO), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_BARTS), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_CAICOS), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_CAYMAN), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_R600_TURKS), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX600), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX601), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX700), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX701), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX702), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX703), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX704), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX801), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX802), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX803), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX810), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX900), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX902), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX904), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX906), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX909), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX1010), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_XNACK), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_SRAM_ECC) +}; static const EnumEntry ElfHeaderRISCVFlags[] = { - ENUM_ENT(EF_RISCV_RVC, "RVC"), - ENUM_ENT(EF_RISCV_FLOAT_ABI_SINGLE, "single-float ABI"), - ENUM_ENT(EF_RISCV_FLOAT_ABI_DOUBLE, "double-float ABI"), - ENUM_ENT(EF_RISCV_FLOAT_ABI_QUAD, "quad-float ABI"), - ENUM_ENT(EF_RISCV_RVE, "RVE")}; + ENUM_ENT(EF_RISCV_RVC, "RVC"), + ENUM_ENT(EF_RISCV_FLOAT_ABI_SINGLE, "single-float ABI"), + ENUM_ENT(EF_RISCV_FLOAT_ABI_DOUBLE, "double-float ABI"), + ENUM_ENT(EF_RISCV_FLOAT_ABI_QUAD, "quad-float ABI"), + ENUM_ENT(EF_RISCV_RVE, "RVE") +}; static const EnumEntry ElfSymOtherFlags[] = { - LLVM_READOBJ_ENUM_ENT(ELF, STV_INTERNAL), - LLVM_READOBJ_ENUM_ENT(ELF, STV_HIDDEN), - LLVM_READOBJ_ENUM_ENT(ELF, STV_PROTECTED)}; + LLVM_READOBJ_ENUM_ENT(ELF, STV_INTERNAL), + LLVM_READOBJ_ENUM_ENT(ELF, STV_HIDDEN), + LLVM_READOBJ_ENUM_ENT(ELF, STV_PROTECTED) +}; static const EnumEntry ElfMipsSymOtherFlags[] = { - LLVM_READOBJ_ENUM_ENT(ELF, STO_MIPS_OPTIONAL), - LLVM_READOBJ_ENUM_ENT(ELF, STO_MIPS_PLT), - LLVM_READOBJ_ENUM_ENT(ELF, STO_MIPS_PIC), - LLVM_READOBJ_ENUM_ENT(ELF, STO_MIPS_MICROMIPS)}; + LLVM_READOBJ_ENUM_ENT(ELF, STO_MIPS_OPTIONAL), + LLVM_READOBJ_ENUM_ENT(ELF, STO_MIPS_PLT), + LLVM_READOBJ_ENUM_ENT(ELF, STO_MIPS_PIC), + LLVM_READOBJ_ENUM_ENT(ELF, STO_MIPS_MICROMIPS) +}; static const EnumEntry ElfMips16SymOtherFlags[] = { - LLVM_READOBJ_ENUM_ENT(ELF, STO_MIPS_OPTIONAL), - LLVM_READOBJ_ENUM_ENT(ELF, STO_MIPS_PLT), - LLVM_READOBJ_ENUM_ENT(ELF, STO_MIPS_MIPS16)}; + LLVM_READOBJ_ENUM_ENT(ELF, STO_MIPS_OPTIONAL), + LLVM_READOBJ_ENUM_ENT(ELF, STO_MIPS_PLT), + LLVM_READOBJ_ENUM_ENT(ELF, STO_MIPS_MIPS16) +}; static const char *getElfMipsOptionsOdkType(unsigned Odk) { switch (Odk) { - LLVM_READOBJ_ENUM_CASE(ELF, ODK_NULL); - LLVM_READOBJ_ENUM_CASE(ELF, ODK_REGINFO); - LLVM_READOBJ_ENUM_CASE(ELF, ODK_EXCEPTIONS); - LLVM_READOBJ_ENUM_CASE(ELF, ODK_PAD); - LLVM_READOBJ_ENUM_CASE(ELF, ODK_HWPATCH); - LLVM_READOBJ_ENUM_CASE(ELF, ODK_FILL); - LLVM_READOBJ_ENUM_CASE(ELF, ODK_TAGS); - LLVM_READOBJ_ENUM_CASE(ELF, ODK_HWAND); - LLVM_READOBJ_ENUM_CASE(ELF, ODK_HWOR); - LLVM_READOBJ_ENUM_CASE(ELF, ODK_GP_GROUP); - LLVM_READOBJ_ENUM_CASE(ELF, ODK_IDENT); - LLVM_READOBJ_ENUM_CASE(ELF, ODK_PAGESIZE); + LLVM_READOBJ_ENUM_CASE(ELF, ODK_NULL); + LLVM_READOBJ_ENUM_CASE(ELF, ODK_REGINFO); + LLVM_READOBJ_ENUM_CASE(ELF, ODK_EXCEPTIONS); + LLVM_READOBJ_ENUM_CASE(ELF, ODK_PAD); + LLVM_READOBJ_ENUM_CASE(ELF, ODK_HWPATCH); + LLVM_READOBJ_ENUM_CASE(ELF, ODK_FILL); + LLVM_READOBJ_ENUM_CASE(ELF, ODK_TAGS); + LLVM_READOBJ_ENUM_CASE(ELF, ODK_HWAND); + LLVM_READOBJ_ENUM_CASE(ELF, ODK_HWOR); + LLVM_READOBJ_ENUM_CASE(ELF, ODK_GP_GROUP); + LLVM_READOBJ_ENUM_CASE(ELF, ODK_IDENT); + LLVM_READOBJ_ENUM_CASE(ELF, ODK_PAGESIZE); default: return "Unknown"; } @@ -1318,7 +1330,7 @@ static const char *getElfMipsOptionsOdkType(unsigned Odk) { template ELFDumper::ELFDumper(const object::ELFObjectFile *ObjF, - ScopedPrinter &Writer) + ScopedPrinter &Writer) : ObjDumper(Writer), ObjF(ObjF) { SmallVector LoadSegments; const ELFFile *Obj = ObjF->getELFFile(); @@ -1561,8 +1573,8 @@ static const char *getTypeString(unsigned Arch, uint64_t Type) { case EM_HEXAGON: switch (Type) { #define HEXAGON_DYNAMIC_TAG(name, value) \ - case DT_##name: \ - return #name; + case DT_##name: \ + return #name; #include "llvm/BinaryFormat/DynamicTags.def" #undef HEXAGON_DYNAMIC_TAG } @@ -1571,18 +1583,18 @@ static const char *getTypeString(unsigned Arch, uint64_t Type) { case EM_MIPS: switch (Type) { #define MIPS_DYNAMIC_TAG(name, value) \ - case DT_##name: \ - return #name; + case DT_##name: \ + return #name; #include "llvm/BinaryFormat/DynamicTags.def" #undef MIPS_DYNAMIC_TAG } break; case EM_PPC64: - switch (Type) { + switch(Type) { #define PPC64_DYNAMIC_TAG(name, value) \ - case DT_##name: \ - return #name; + case DT_##name: \ + return #name; #include "llvm/BinaryFormat/DynamicTags.def" #undef PPC64_DYNAMIC_TAG } @@ -1614,57 +1626,60 @@ static const char *getTypeString(unsigned Arch, uint64_t Type) { { #enum, prefix##_##enum } static const EnumEntry ElfDynamicDTFlags[] = { - LLVM_READOBJ_DT_FLAG_ENT(DF, ORIGIN), - LLVM_READOBJ_DT_FLAG_ENT(DF, SYMBOLIC), - LLVM_READOBJ_DT_FLAG_ENT(DF, TEXTREL), - LLVM_READOBJ_DT_FLAG_ENT(DF, BIND_NOW), - LLVM_READOBJ_DT_FLAG_ENT(DF, STATIC_TLS)}; + LLVM_READOBJ_DT_FLAG_ENT(DF, ORIGIN), + LLVM_READOBJ_DT_FLAG_ENT(DF, SYMBOLIC), + LLVM_READOBJ_DT_FLAG_ENT(DF, TEXTREL), + LLVM_READOBJ_DT_FLAG_ENT(DF, BIND_NOW), + LLVM_READOBJ_DT_FLAG_ENT(DF, STATIC_TLS) +}; static const EnumEntry ElfDynamicDTFlags1[] = { - LLVM_READOBJ_DT_FLAG_ENT(DF_1, NOW), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, GLOBAL), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, GROUP), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, NODELETE), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, LOADFLTR), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, INITFIRST), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, NOOPEN), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, ORIGIN), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, DIRECT), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, TRANS), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, INTERPOSE), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, NODEFLIB), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, NODUMP), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, CONFALT), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, ENDFILTEE), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, DISPRELDNE), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, DISPRELPND), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, NODIRECT), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, IGNMULDEF), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, NOKSYMS), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, NOHDR), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, EDITED), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, NORELOC), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, SYMINTPOSE), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, GLOBAUDIT), - LLVM_READOBJ_DT_FLAG_ENT(DF_1, SINGLETON)}; + LLVM_READOBJ_DT_FLAG_ENT(DF_1, NOW), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, GLOBAL), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, GROUP), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, NODELETE), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, LOADFLTR), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, INITFIRST), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, NOOPEN), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, ORIGIN), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, DIRECT), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, TRANS), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, INTERPOSE), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, NODEFLIB), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, NODUMP), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, CONFALT), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, ENDFILTEE), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, DISPRELDNE), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, DISPRELPND), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, NODIRECT), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, IGNMULDEF), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, NOKSYMS), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, NOHDR), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, EDITED), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, NORELOC), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, SYMINTPOSE), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, GLOBAUDIT), + LLVM_READOBJ_DT_FLAG_ENT(DF_1, SINGLETON) +}; static const EnumEntry ElfDynamicDTMipsFlags[] = { - LLVM_READOBJ_DT_FLAG_ENT(RHF, NONE), - LLVM_READOBJ_DT_FLAG_ENT(RHF, QUICKSTART), - LLVM_READOBJ_DT_FLAG_ENT(RHF, NOTPOT), - LLVM_READOBJ_DT_FLAG_ENT(RHS, NO_LIBRARY_REPLACEMENT), - LLVM_READOBJ_DT_FLAG_ENT(RHF, NO_MOVE), - LLVM_READOBJ_DT_FLAG_ENT(RHF, SGI_ONLY), - LLVM_READOBJ_DT_FLAG_ENT(RHF, GUARANTEE_INIT), - LLVM_READOBJ_DT_FLAG_ENT(RHF, DELTA_C_PLUS_PLUS), - LLVM_READOBJ_DT_FLAG_ENT(RHF, GUARANTEE_START_INIT), - LLVM_READOBJ_DT_FLAG_ENT(RHF, PIXIE), - LLVM_READOBJ_DT_FLAG_ENT(RHF, DEFAULT_DELAY_LOAD), - LLVM_READOBJ_DT_FLAG_ENT(RHF, REQUICKSTART), - LLVM_READOBJ_DT_FLAG_ENT(RHF, REQUICKSTARTED), - LLVM_READOBJ_DT_FLAG_ENT(RHF, CORD), - LLVM_READOBJ_DT_FLAG_ENT(RHF, NO_UNRES_UNDEF), - LLVM_READOBJ_DT_FLAG_ENT(RHF, RLD_ORDER_SAFE)}; + LLVM_READOBJ_DT_FLAG_ENT(RHF, NONE), + LLVM_READOBJ_DT_FLAG_ENT(RHF, QUICKSTART), + LLVM_READOBJ_DT_FLAG_ENT(RHF, NOTPOT), + LLVM_READOBJ_DT_FLAG_ENT(RHS, NO_LIBRARY_REPLACEMENT), + LLVM_READOBJ_DT_FLAG_ENT(RHF, NO_MOVE), + LLVM_READOBJ_DT_FLAG_ENT(RHF, SGI_ONLY), + LLVM_READOBJ_DT_FLAG_ENT(RHF, GUARANTEE_INIT), + LLVM_READOBJ_DT_FLAG_ENT(RHF, DELTA_C_PLUS_PLUS), + LLVM_READOBJ_DT_FLAG_ENT(RHF, GUARANTEE_START_INIT), + LLVM_READOBJ_DT_FLAG_ENT(RHF, PIXIE), + LLVM_READOBJ_DT_FLAG_ENT(RHF, DEFAULT_DELAY_LOAD), + LLVM_READOBJ_DT_FLAG_ENT(RHF, REQUICKSTART), + LLVM_READOBJ_DT_FLAG_ENT(RHF, REQUICKSTARTED), + LLVM_READOBJ_DT_FLAG_ENT(RHF, CORD), + LLVM_READOBJ_DT_FLAG_ENT(RHF, NO_UNRES_UNDEF), + LLVM_READOBJ_DT_FLAG_ENT(RHF, RLD_ORDER_SAFE) +}; #undef LLVM_READOBJ_DT_FLAG_ENT @@ -1942,7 +1957,7 @@ public: using Entries = ArrayRef; const bool IsStatic; - const ELFO *const Obj; + const ELFO * const Obj; MipsGOTParser(const ELFO *Obj, Elf_Dyn_Range DynTable, Elf_Sym_Range DynSyms); @@ -1961,11 +1976,11 @@ public: Entries getOtherEntries() const; Entries getPltEntries() const; - uint64_t getGotAddress(const Entry *E) const; - int64_t getGotOffset(const Entry *E) const; + uint64_t getGotAddress(const Entry * E) const; + int64_t getGotOffset(const Entry * E) const; const Elf_Sym *getGotSym(const Entry *E) const; - uint64_t getPltAddress(const Entry *E) const; + uint64_t getPltAddress(const Entry * E) const; const Elf_Sym *getPltSym(const Entry *E) const; StringRef getPltStrTable() const { return PltStrTable; } @@ -2207,59 +2222,61 @@ template void ELFDumper::printMipsPLTGOT() { } static const EnumEntry ElfMipsISAExtType[] = { - {"None", Mips::AFL_EXT_NONE}, - {"Broadcom SB-1", Mips::AFL_EXT_SB1}, - {"Cavium Networks Octeon", Mips::AFL_EXT_OCTEON}, - {"Cavium Networks Octeon2", Mips::AFL_EXT_OCTEON2}, - {"Cavium Networks OcteonP", Mips::AFL_EXT_OCTEONP}, - {"Cavium Networks Octeon3", Mips::AFL_EXT_OCTEON3}, - {"LSI R4010", Mips::AFL_EXT_4010}, - {"Loongson 2E", Mips::AFL_EXT_LOONGSON_2E}, - {"Loongson 2F", Mips::AFL_EXT_LOONGSON_2F}, - {"Loongson 3A", Mips::AFL_EXT_LOONGSON_3A}, - {"MIPS R4650", Mips::AFL_EXT_4650}, - {"MIPS R5900", Mips::AFL_EXT_5900}, - {"MIPS R10000", Mips::AFL_EXT_10000}, - {"NEC VR4100", Mips::AFL_EXT_4100}, - {"NEC VR4111/VR4181", Mips::AFL_EXT_4111}, - {"NEC VR4120", Mips::AFL_EXT_4120}, - {"NEC VR5400", Mips::AFL_EXT_5400}, - {"NEC VR5500", Mips::AFL_EXT_5500}, - {"RMI Xlr", Mips::AFL_EXT_XLR}, - {"Toshiba R3900", Mips::AFL_EXT_3900}}; + {"None", Mips::AFL_EXT_NONE}, + {"Broadcom SB-1", Mips::AFL_EXT_SB1}, + {"Cavium Networks Octeon", Mips::AFL_EXT_OCTEON}, + {"Cavium Networks Octeon2", Mips::AFL_EXT_OCTEON2}, + {"Cavium Networks OcteonP", Mips::AFL_EXT_OCTEONP}, + {"Cavium Networks Octeon3", Mips::AFL_EXT_OCTEON3}, + {"LSI R4010", Mips::AFL_EXT_4010}, + {"Loongson 2E", Mips::AFL_EXT_LOONGSON_2E}, + {"Loongson 2F", Mips::AFL_EXT_LOONGSON_2F}, + {"Loongson 3A", Mips::AFL_EXT_LOONGSON_3A}, + {"MIPS R4650", Mips::AFL_EXT_4650}, + {"MIPS R5900", Mips::AFL_EXT_5900}, + {"MIPS R10000", Mips::AFL_EXT_10000}, + {"NEC VR4100", Mips::AFL_EXT_4100}, + {"NEC VR4111/VR4181", Mips::AFL_EXT_4111}, + {"NEC VR4120", Mips::AFL_EXT_4120}, + {"NEC VR5400", Mips::AFL_EXT_5400}, + {"NEC VR5500", Mips::AFL_EXT_5500}, + {"RMI Xlr", Mips::AFL_EXT_XLR}, + {"Toshiba R3900", Mips::AFL_EXT_3900} +}; static const EnumEntry ElfMipsASEFlags[] = { - {"DSP", Mips::AFL_ASE_DSP}, - {"DSPR2", Mips::AFL_ASE_DSPR2}, - {"Enhanced VA Scheme", Mips::AFL_ASE_EVA}, - {"MCU", Mips::AFL_ASE_MCU}, - {"MDMX", Mips::AFL_ASE_MDMX}, - {"MIPS-3D", Mips::AFL_ASE_MIPS3D}, - {"MT", Mips::AFL_ASE_MT}, - {"SmartMIPS", Mips::AFL_ASE_SMARTMIPS}, - {"VZ", Mips::AFL_ASE_VIRT}, - {"MSA", Mips::AFL_ASE_MSA}, - {"MIPS16", Mips::AFL_ASE_MIPS16}, - {"microMIPS", Mips::AFL_ASE_MICROMIPS}, - {"XPA", Mips::AFL_ASE_XPA}, - {"CRC", Mips::AFL_ASE_CRC}, - {"GINV", Mips::AFL_ASE_GINV}, + {"DSP", Mips::AFL_ASE_DSP}, + {"DSPR2", Mips::AFL_ASE_DSPR2}, + {"Enhanced VA Scheme", Mips::AFL_ASE_EVA}, + {"MCU", Mips::AFL_ASE_MCU}, + {"MDMX", Mips::AFL_ASE_MDMX}, + {"MIPS-3D", Mips::AFL_ASE_MIPS3D}, + {"MT", Mips::AFL_ASE_MT}, + {"SmartMIPS", Mips::AFL_ASE_SMARTMIPS}, + {"VZ", Mips::AFL_ASE_VIRT}, + {"MSA", Mips::AFL_ASE_MSA}, + {"MIPS16", Mips::AFL_ASE_MIPS16}, + {"microMIPS", Mips::AFL_ASE_MICROMIPS}, + {"XPA", Mips::AFL_ASE_XPA}, + {"CRC", Mips::AFL_ASE_CRC}, + {"GINV", Mips::AFL_ASE_GINV}, }; static const EnumEntry ElfMipsFpABIType[] = { - {"Hard or soft float", Mips::Val_GNU_MIPS_ABI_FP_ANY}, - {"Hard float (double precision)", Mips::Val_GNU_MIPS_ABI_FP_DOUBLE}, - {"Hard float (single precision)", Mips::Val_GNU_MIPS_ABI_FP_SINGLE}, - {"Soft float", Mips::Val_GNU_MIPS_ABI_FP_SOFT}, - {"Hard float (MIPS32r2 64-bit FPU 12 callee-saved)", - Mips::Val_GNU_MIPS_ABI_FP_OLD_64}, - {"Hard float (32-bit CPU, Any FPU)", Mips::Val_GNU_MIPS_ABI_FP_XX}, - {"Hard float (32-bit CPU, 64-bit FPU)", Mips::Val_GNU_MIPS_ABI_FP_64}, - {"Hard float compat (32-bit CPU, 64-bit FPU)", - Mips::Val_GNU_MIPS_ABI_FP_64A}}; + {"Hard or soft float", Mips::Val_GNU_MIPS_ABI_FP_ANY}, + {"Hard float (double precision)", Mips::Val_GNU_MIPS_ABI_FP_DOUBLE}, + {"Hard float (single precision)", Mips::Val_GNU_MIPS_ABI_FP_SINGLE}, + {"Soft float", Mips::Val_GNU_MIPS_ABI_FP_SOFT}, + {"Hard float (MIPS32r2 64-bit FPU 12 callee-saved)", + Mips::Val_GNU_MIPS_ABI_FP_OLD_64}, + {"Hard float (32-bit CPU, Any FPU)", Mips::Val_GNU_MIPS_ABI_FP_XX}, + {"Hard float (32-bit CPU, 64-bit FPU)", Mips::Val_GNU_MIPS_ABI_FP_64}, + {"Hard float compat (32-bit CPU, 64-bit FPU)", + Mips::Val_GNU_MIPS_ABI_FP_64A} +}; -static const EnumEntry ElfMipsFlags1[]{ - {"ODDSPREG", Mips::AFL_FLAGS1_ODDSPREG}, +static const EnumEntry ElfMipsFlags1[] { + {"ODDSPREG", Mips::AFL_FLAGS1_ODDSPREG}, }; static int getMipsRegisterSize(uint8_t Flag) { @@ -3455,7 +3472,7 @@ void GNUStyle::printHashHistogram(const ELFFile *Obj) { if (!TotalSyms) return; - std::vector Count(MaxChain, 0); + std::vector Count(MaxChain, 0) ; // Count how long is the chain for each bucket for (size_t B = 0; B < NBucket; B++) ++Count[ChainLen[B]]; @@ -3506,7 +3523,7 @@ void GNUStyle::printHashHistogram(const ELFFile *Obj) { if (!TotalSyms) return; - std::vector Count(MaxChain, 0); + std::vector Count(MaxChain, 0) ; for (size_t B = 0; B < NBucket; B++) ++Count[ChainLen[B]]; // Print Number of buckets with each chain lengths and their cumulative @@ -3514,7 +3531,7 @@ void GNUStyle::printHashHistogram(const ELFFile *Obj) { OS << "Histogram for `.gnu.hash' bucket list length (total of " << NBucket << " buckets)\n" << " Length Number % of total Coverage\n"; - for (size_t I = 0; I < MaxChain; I++) { + for (size_t I = 0; I ::printCGProfile(const ELFFile *Obj) { template void GNUStyle::printAddrsig(const ELFFile *Obj) { - OS << "GNUStyle::printAddrsig not implemented\n"; + OS << "GNUStyle::printAddrsig not implemented\n"; } static StringRef getGenericNoteTypeName(const uint32_t NT) { @@ -4790,7 +4807,7 @@ void LLVMStyle::printELFLinkerOptions(const ELFFile *Obj) { continue; ArrayRef Contents = unwrapOrError(Obj->getSectionContents(&Shdr)); - for (const uint8_t *P = Contents.begin(), *E = Contents.end(); P < E;) { + for (const uint8_t *P = Contents.begin(), *E = Contents.end(); P < E; ) { StringRef Key = StringRef(reinterpret_cast(P)); StringRef Value = StringRef(reinterpret_cast(P) + Key.size() + 1);