LCOV - code coverage report
Current view: top level - libdwelf - dwelf_elf_e_machine_string.c (source / functions) Hit Total Coverage
Test: elfutils-0.178 Lines: 360 362 99.4 %
Date: 2019-11-26 23:55:16 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* Returns a human readable description of an ELF header e_machine value.
       2             :    Copyright (C) 2019 Red Hat, Inc.
       3             :    This file is part of elfutils.
       4             : 
       5             :    This file is free software; you can redistribute it and/or modify
       6             :    it under the terms of either
       7             : 
       8             :      * the GNU Lesser General Public License as published by the Free
       9             :        Software Foundation; either version 3 of the License, or (at
      10             :        your option) any later version
      11             : 
      12             :    or
      13             : 
      14             :      * the GNU General Public License as published by the Free
      15             :        Software Foundation; either version 2 of the License, or (at
      16             :        your option) any later version
      17             : 
      18             :    or both in parallel, as here.
      19             : 
      20             :    elfutils is distributed in the hope that it will be useful, but
      21             :    WITHOUT ANY WARRANTY; without even the implied warranty of
      22             :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      23             :    General Public License for more details.
      24             : 
      25             :    You should have received copies of the GNU General Public License and
      26             :    the GNU Lesser General Public License along with this program.  If
      27             :    not, see <http://www.gnu.org/licenses/>.  */
      28             : 
      29             : #ifdef HAVE_CONFIG_H
      30             : # include <config.h>
      31             : #endif
      32             : 
      33             : #include "libdwelf.h"
      34             : 
      35             : 
      36             : const char *
      37         236 : dwelf_elf_e_machine_string (int machine)
      38             : {
      39         236 :   switch (machine)
      40             :     {
      41             :     case EM_NONE:
      42             :       return "None";
      43           1 :     case EM_M32:
      44           1 :       return "WE32100";
      45           1 :     case EM_SPARC:
      46           1 :       return "SPARC";
      47           9 :     case EM_386:
      48           9 :       return "Intel 80386";
      49           3 :     case EM_68K:
      50           3 :       return "M68K";
      51           1 :     case EM_88K:
      52           1 :       return "M88K";
      53           1 :     case EM_IAMCU:
      54           1 :       return "Intel MCU";
      55           1 :     case EM_860:
      56           1 :       return "Intel 80860";
      57           1 :     case EM_MIPS:
      58           1 :       return "MIPS R3000";
      59           1 :     case EM_S370:
      60           1 :       return "IBM System/370";
      61           1 :     case EM_MIPS_RS3_LE:
      62           1 :       return "MIPS R3000";
      63           1 :     case EM_PARISC:
      64           1 :       return "HPPA";
      65           1 :     case EM_VPP500:
      66           1 :       return "Fujitsu VPP500";
      67           1 :     case EM_SPARC32PLUS:
      68           1 :       return "SPARC v8+";
      69           1 :     case EM_960:
      70           1 :       return "Intel 80960";
      71           1 :     case EM_PPC:
      72           1 :       return "PowerPC";
      73           9 :     case EM_PPC64:
      74           9 :       return "PowerPC64";
      75           3 :     case EM_S390:
      76           3 :       return "IBM S/390";
      77           1 :     case EM_SPU:
      78           1 :       return "IBM SPU/SPC";
      79           1 :     case EM_V800:
      80           1 :       return "NEC V800";
      81           1 :     case EM_FR20:
      82           1 :       return "Fujitsu FR20";
      83           1 :     case EM_RH32:
      84           1 :       return "TRW RH-32";
      85           1 :     case EM_RCE:
      86           1 :       return "Motorola RCE";
      87           1 :     case EM_ARM:
      88           1 :       return "ARM";
      89           1 :     case EM_FAKE_ALPHA:
      90           1 :       return "Digital Alpha";
      91           1 :     case EM_SH:
      92           1 :       return "SH";
      93           1 :     case EM_SPARCV9:
      94           1 :       return "SPARC v9";
      95           1 :     case EM_TRICORE:
      96           1 :       return "Siemens Tricore";
      97           1 :     case EM_ARC:
      98           1 :       return "ARC";
      99           1 :     case EM_H8_300:
     100           1 :       return "H8/300";
     101           1 :     case EM_H8_300H:
     102           1 :       return "H8/300H";
     103           1 :     case EM_H8S:
     104           1 :       return "H8S";
     105           1 :     case EM_H8_500:
     106           1 :       return "H8/500";
     107           1 :     case EM_IA_64:
     108           1 :       return "Intel IA-64";
     109           1 :     case EM_MIPS_X:
     110           1 :       return "Stanford MIPS-X";
     111           1 :     case EM_COLDFIRE:
     112           1 :       return "Motorola Coldfire";
     113           1 :     case EM_68HC12:
     114           1 :       return "Motorola M68HC12";
     115           1 :     case EM_MMA:
     116           1 :       return "Fujitsu MMA Multimedia Accelerator";
     117           1 :     case EM_PCP:
     118           1 :       return "Siemens PCP";
     119           1 :     case EM_NCPU:
     120           1 :       return "Sony nCPU embeded RISC";
     121           1 :     case EM_NDR1:
     122           1 :       return "Denso NDR1 microprocessor";
     123           1 :     case EM_STARCORE:
     124           1 :       return "Motorola Star*Core processor";
     125           1 :     case EM_ME16:
     126           1 :       return "Toyota ME16 processor";
     127           1 :     case EM_ST100:
     128           1 :       return "STMicroelectronic ST100";
     129           1 :     case EM_TINYJ:
     130           1 :       return "Advanced Logic Corporation Tinyj";
     131          30 :     case EM_X86_64:
     132          30 :       return "AMD x86-64";
     133           1 :     case EM_PDSP:
     134           1 :       return "Sony DSP Processor";
     135           1 :     case EM_PDP10:
     136           1 :       return "Digital PDP-10";
     137           1 :     case EM_PDP11:
     138           1 :       return "Digital PDP-11";
     139           1 :     case EM_FX66:
     140           1 :       return "Siemens FX66 microcontroller";
     141           1 :     case EM_ST9PLUS:
     142           1 :       return "STMicroelectronics ST9+";
     143           1 :     case EM_ST7:
     144           1 :       return "STMicroelectronics ST7";
     145           1 :     case EM_68HC16:
     146           1 :       return "Motorola MC68HC16 microcontroller";
     147           1 :     case EM_68HC11:
     148           1 :       return "Motorola MC68HC11 microcontroller";
     149           1 :     case EM_68HC08:
     150           1 :       return "Motorola MC68HC08 microcontroller";
     151           1 :     case EM_68HC05:
     152           1 :       return "Motorola MC68HC05 microcontroller";
     153           1 :     case EM_SVX:
     154           1 :       return "Silicon Graphics SVx";
     155           1 :     case EM_ST19:
     156           1 :       return "STMicroelectronics ST19";
     157           1 :     case EM_VAX:
     158           1 :       return "Digital VAX";
     159           1 :     case EM_CRIS:
     160           1 :       return "Axis Communications 32-bit embedded processor";
     161           1 :     case EM_JAVELIN:
     162           1 :       return "Infineon Technologies 32-bit embedded processor";
     163           1 :     case EM_FIREPATH:
     164           1 :       return "Element 14 64-bit DSP Processor";
     165           1 :     case EM_ZSP:
     166           1 :       return "LSI Logic 16-bit DSP Processor";
     167           1 :     case EM_MMIX:
     168           1 :       return "Donald Knuth's educational 64-bit processor";
     169           1 :     case EM_HUANY:
     170           1 :       return "Harvard University machine-independent object";
     171           1 :     case EM_PRISM:
     172           1 :       return "SiTera Prism";
     173           1 :     case EM_AVR:
     174           1 :       return "Atmel AVR 8-bit microcontroller";
     175           1 :     case EM_FR30:
     176           1 :       return "Fujitsu FR30";
     177           1 :     case EM_D10V:
     178           1 :       return "Mitsubishi D10V";
     179           1 :     case EM_D30V:
     180           1 :       return "Mitsubishi D30V";
     181           1 :     case EM_V850:
     182           1 :       return "NEC v850";
     183           1 :     case EM_M32R:
     184           1 :       return "Mitsubishi M32R";
     185           1 :     case EM_MN10300:
     186           1 :       return "Matsushita MN10300";
     187           1 :     case EM_MN10200:
     188           1 :       return "Matsushita MN10200";
     189           1 :     case EM_PJ:
     190           1 :       return "picoJava";
     191           1 :     case EM_OPENRISC:
     192           1 :       return "OpenRISC";
     193           2 :     case EM_ARC_COMPACT:
     194           2 :       return "ARC International ARCompact";
     195           1 :     case EM_XTENSA:
     196           1 :       return "Tensilica Xtensa Architecture";
     197           1 :     case EM_VIDEOCORE:
     198           1 :       return "Alphamosaic VideoCore";
     199           1 :     case EM_TMM_GPP:
     200           1 :       return "Thompson Multimedia General Purpose Processor";
     201           1 :     case EM_NS32K:
     202           1 :       return "National Semiconductor 32000";
     203           1 :     case EM_TPC:
     204           1 :       return "Tenor Network TPC";
     205           1 :     case EM_SNP1K:
     206           1 :       return "Trebia SNP 1000";
     207           1 :     case EM_ST200:
     208           1 :       return "STMicroelectronics ST200";
     209           1 :     case EM_IP2K:
     210           1 :       return "Ubicom IP2xxx";
     211           1 :     case EM_MAX:
     212           1 :       return "MAX processor";
     213           1 :     case EM_CR:
     214           1 :       return "National Semiconductor CompactRISC";
     215           1 :     case EM_F2MC16:
     216           1 :       return "Fujitsu F2MC16";
     217           1 :     case EM_MSP430:
     218           1 :       return "Texas Instruments msp430";
     219           1 :     case EM_BLACKFIN:
     220           1 :       return "Analog Devices Blackfin DSP";
     221           1 :     case EM_SE_C33:
     222           1 :       return "Seiko Epson S1C33";
     223           1 :     case EM_SEP:
     224           1 :       return "Sharp embedded microprocessor";
     225           1 :     case EM_ARCA:
     226           1 :       return "Arca RISC";
     227           1 :     case EM_UNICORE:
     228           1 :       return "Unicore";
     229           1 :     case EM_EXCESS:
     230           1 :       return "eXcess configurable CPU";
     231           1 :     case EM_DXP:
     232           1 :       return "Icera Semiconductor Deep Execution Processor";
     233           1 :     case EM_ALTERA_NIOS2:
     234           1 :       return "Altera Nios II";
     235           1 :     case EM_CRX:
     236           1 :       return "National Semiconductor CompactRISC CRX";
     237           1 :     case EM_XGATE:
     238           1 :       return "Motorola XGATE";
     239           1 :     case EM_C166:
     240           1 :       return "Infineon C16x/XC16x";
     241           1 :     case EM_M16C:
     242           1 :       return "Renesas M16C";
     243           1 :     case EM_DSPIC30F:
     244           1 :       return "Microchip Technology dsPIC30F";
     245           1 :     case EM_CE:
     246           1 :       return "Freescale Communication Engine RISC";
     247           1 :     case EM_M32C:
     248           1 :       return "Renesas M32C";
     249           1 :     case EM_TSK3000:
     250           1 :       return "Altium TSK3000";
     251           1 :     case EM_RS08:
     252           1 :       return "Freescale RS08";
     253           1 :     case EM_SHARC:
     254           1 :       return "Analog Devices SHARC";
     255           1 :     case EM_ECOG2:
     256           1 :       return "Cyan Technology eCOG2";
     257           1 :     case EM_SCORE7:
     258           1 :       return "Sunplus S+core7 RISC";
     259           1 :     case EM_DSP24:
     260           1 :       return "New Japan Radio (NJR) 24-bit DSP";
     261           1 :     case EM_VIDEOCORE3:
     262           1 :       return "Broadcom VideoCore III";
     263           1 :     case EM_LATTICEMICO32:
     264           1 :       return "RISC for Lattice FPGA";
     265           1 :     case EM_SE_C17:
     266           1 :       return "Seiko Epson C17";
     267           1 :     case EM_TI_C6000:
     268           1 :       return "Texas Instruments TMS320C6000 DSP";
     269           1 :     case EM_TI_C2000:
     270           1 :       return "Texas Instruments TMS320C2000 DSP";
     271           1 :     case EM_TI_C5500:
     272           1 :       return "Texas Instruments TMS320C55x DSP";
     273           1 :     case EM_TI_ARP32:
     274           1 :       return "Texas Instruments Application Specific RISC";
     275           1 :     case EM_TI_PRU:
     276           1 :       return "Texas Instruments Programmable Realtime Unit";
     277           1 :     case EM_MMDSP_PLUS:
     278           1 :       return "STMicroelectronics 64bit VLIW DSP";
     279           1 :     case EM_CYPRESS_M8C:
     280           1 :       return "Cypress M8C";
     281           1 :     case EM_R32C:
     282           1 :       return "Renesas R32C";
     283           1 :     case EM_TRIMEDIA:
     284           1 :       return "NXP Semiconductors TriMedia";
     285           1 :     case EM_QDSP6:
     286           1 :       return "QUALCOMM DSP6";
     287           1 :     case EM_8051:
     288           1 :       return "Intel 8051 and variants";
     289           1 :     case EM_STXP7X:
     290           1 :       return "STMicroelectronics STxP7x";
     291           1 :     case EM_NDS32:
     292           1 :       return "Andes Technology compact code size embeded RISC";
     293           1 :     case EM_ECOG1X:
     294           1 :       return "Cyan Technology eCOG1X";
     295           1 :     case EM_MAXQ30:
     296           1 :       return "Dallas Semicondutor MAXQ30";
     297           1 :     case EM_XIMO16:
     298           1 :       return "New Japan Radio (NJR) 16-bit DSP";
     299           1 :     case EM_MANIK:
     300           1 :       return "M2000 Reconfigurable RISC";
     301           1 :     case EM_CRAYNV2:
     302           1 :       return "Cray NV2 vector architecture";
     303           1 :     case EM_RX:
     304           1 :       return "Renesas RX";
     305           1 :     case EM_METAG:
     306           1 :       return "Imagination Technologies META";
     307           1 :     case EM_MCST_ELBRUS:
     308           1 :       return "MCST Elbrus";
     309           1 :     case EM_ECOG16:
     310           1 :       return "Cyan Technology eCOG16";
     311           1 :     case EM_CR16:
     312           1 :       return "National Semiconductor CompactRISC";
     313           1 :     case EM_ETPU:
     314           1 :       return "Freescale Extended Time Processing Unit";
     315           1 :     case EM_SLE9X:
     316           1 :       return "Infineon Technologies SLE9X";
     317           1 :     case EM_L10M:
     318           1 :       return "Intel L10M";
     319           1 :     case EM_K10M:
     320           1 :       return "Intel K10M";
     321           3 :     case EM_AARCH64:
     322           3 :       return "AARCH64";
     323           1 :     case EM_AVR32:
     324           1 :       return "Amtel AVR32";
     325           1 :     case EM_STM8:
     326           1 :       return "STMicroelectronics STM8";
     327           1 :     case EM_TILE64:
     328           1 :       return "Tilera TILE64";
     329           1 :     case EM_TILEPRO:
     330           1 :       return "Tilera TILEPro";
     331           1 :     case EM_MICROBLAZE:
     332           1 :       return "Xilinx MicroBlaze";
     333           1 :     case EM_CUDA:
     334           1 :       return "NVIDIA CUDA";
     335           1 :     case EM_TILEGX:
     336           1 :       return "Tilera TILE-Gx";
     337           1 :     case EM_CLOUDSHIELD:
     338           1 :       return "CloudShield";
     339           1 :     case EM_COREA_1ST:
     340           1 :       return "KIPO-KAIST Core-A 1st gen";
     341           1 :     case EM_COREA_2ND:
     342           1 :       return "KIPO-KAIST Core-A 2nd gen";
     343           1 :     case EM_ARC_COMPACT2:
     344           1 :       return "Synopsys ARCompact V2";
     345           1 :     case EM_OPEN8:
     346           1 :       return "Open8 RISC";
     347           1 :     case EM_RL78:
     348           1 :       return "Renesas RL78";
     349           1 :     case EM_VIDEOCORE5:
     350           1 :       return "Broadcom VideoCore V";
     351           1 :     case EM_78KOR:
     352           1 :       return "Renesas 78KOR";
     353           1 :     case EM_56800EX:
     354           1 :       return "Freescale 56800EX DSC";
     355           1 :     case EM_BA1:
     356           1 :       return "Beyond BA1";
     357           1 :     case EM_BA2:
     358           1 :       return "Beyond BA2";
     359           1 :     case EM_XCORE:
     360           1 :       return "XMOS xCORE";
     361           1 :     case EM_MCHP_PIC:
     362           1 :       return "Microchip 8-bit PIC";
     363           1 :     case EM_KM32:
     364           1 :       return "KM211 KM32";
     365           1 :     case EM_KMX32:
     366           1 :       return "KM211 KMX32";
     367           1 :     case EM_EMX16:
     368           1 :       return "KM211 KMX16";
     369           1 :     case EM_EMX8:
     370           1 :       return "KM211 KMX8";
     371           1 :     case EM_KVARC:
     372           1 :       return "KM211 KVARC";
     373           1 :     case EM_CDP:
     374           1 :       return "Paneve CDP";
     375           1 :     case EM_COGE:
     376           1 :       return "Cognitive Smart Memory Processor";
     377           1 :     case EM_COOL:
     378           1 :       return "Bluechip CoolEngine";
     379           1 :     case EM_NORC:
     380           1 :       return "Nanoradio Optimized RISC";
     381           1 :     case EM_CSR_KALIMBA:
     382           1 :       return "CSR Kalimba";
     383           1 :     case EM_Z80:
     384           1 :       return "Zilog Z80";
     385           1 :     case EM_VISIUM:
     386           1 :       return "CDS VISIUMcore";
     387           1 :     case EM_FT32:
     388           1 :       return "FTDI Chip FT32";
     389           1 :     case EM_MOXIE:
     390           1 :       return "Moxie";
     391           1 :     case EM_AMDGPU:
     392           1 :       return "AMD GPU";
     393           3 :     case EM_RISCV:
     394           3 :       return "RISC-V";
     395           1 :     case EM_BPF:
     396           1 :       return "BPF";
     397           3 :     case EM_CSKY:
     398           3 :       return "C-SKY";
     399             : 
     400           1 :     case EM_ALPHA:
     401           1 :       return "Alpha";
     402             : 
     403           0 :     default:
     404           0 :       return NULL;
     405             :     }
     406             : }

Generated by: LCOV version 1.13