module ELFTools::Constants::EM

These constants define the various ELF target machines.

Constants

EM_386
EM_486
EM_68K
EM_860
EM_88K
EM_AARCH64
EM_ALPHA

This is an interim value that we will use until the committee comes up with a final number.

EM_ALTERA_NIOS2
EM_ARM
EM_AVR32
EM_BLACKFIN
EM_BPF
EM_CRIS
EM_CYGNUS_M32R

Bogus old m32r magic number, used by old tools.

EM_CYGNUS_MN10300

Also Panasonic/MEI MN10300, AM33

EM_FRV
EM_H8_300
EM_IA_64
EM_M32
EM_M32R
EM_MICROBLAZE
EM_MIPS
EM_MIPS_RS3_LE

Next two are historical and binaries and modules of these types will be rejected by Linux.

EM_MIPS_RS4_BE
EM_MN10300
EM_NONE
EM_OPENRISC
EM_PARISC
EM_PPC
EM_PPC64
EM_S390
EM_S390_OLD

This is the old interim value for S/390 architecture

EM_SH
EM_SPARC
EM_SPARC32PLUS
EM_SPARCV9
EM_SPU
EM_TILEGX
EM_TILEPRO
EM_TI_C6000
EM_X86_64

Public Class Methods

mapping(val) click to toggle source

Return the architecture name according to val. Used by {ELFTools::ELFFile#machine}.

Only supports famous archs. @param [Integer] val Value of e_machine. @return [String]

Name of architecture.

@example

mapping(3)
#=> 'Intel 80386'
mapping(6)
#=> 'Intel 80386'
mapping(62)
#=> 'Advanced Micro Devices X86-64'
mapping(1337)
#=> '<unknown>: 0x539'
# File lib/elftools/constants.rb, line 176
def self.mapping(val)
  case val
  when EM_NONE then 'None'
  when EM_386, EM_486 then 'Intel 80386'
  when EM_860 then 'Intel 80860'
  when EM_MIPS then 'MIPS R3000'
  when EM_PPC then 'PowerPC'
  when EM_PPC64 then 'PowerPC64'
  when EM_ARM then 'ARM'
  when EM_IA_64 then 'Intel IA-64'
  when EM_AARCH64 then 'AArch64'
  when EM_X86_64 then 'Advanced Micro Devices X86-64'
  else format('<unknown>: 0x%x', val)
  end
end