Module: ELFTools::Constants::EM

Included in:
ELFTools::Constants
Defined in:
lib/elftools/constants.rb

Overview

These constants define the various ELF target machines.

Constant Summary collapse

EM_NONE =

none

0
EM_M32 =

AT&T WE 32100

1
EM_SPARC =

SPARC

2
EM_386 =

Intel 80386

3
EM_68K =

Motorola 68000

4
EM_88K =

Motorola 88000

5
EM_486 =

Intel 80486

6
EM_860 =

Intel 80860

7
EM_MIPS =

MIPS R3000 (officially, big-endian only)

8
EM_MIPS_RS3_LE =

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

10
EM_MIPS_RS4_BE =

MIPS R3000 little-endian

10
EM_PARISC =

MIPS R4000 big-endian

15
EM_SPARC32PLUS =

HPPA

18
EM_PPC =

Sun’s “v8plus”

20
EM_PPC64 =

PowerPC

21
EM_SPU =

PowerPC64

23
EM_ARM =

Cell BE SPU

40
EM_SH =

ARM 32 bit

42
EM_SPARCV9 =

SuperH

43
EM_H8_300 =

SPARC v9 64-bit

46
EM_IA_64 =

Renesas H8/300

50
EM_X86_64 =

HP/Intel IA-64

62
EM_S390 =

AMD x86-64

22
EM_CRIS =

IBM S/390

76
EM_M32R =

Axis Communications 32-bit embedded processor

88
EM_MN10300 =

Renesas M32R

89
EM_OPENRISC =

Panasonic/MEI MN10300, AM33

92
EM_BLACKFIN =

OpenRISC 32-bit embedded processor

106
EM_ALTERA_NIOS2 =

ADI Blackfin Processor

113
EM_TI_C6000 =

Altera Nios II soft-core processor

140
EM_AARCH64 =

TI C6X DSPs

183
EM_TILEPRO =

ARM 64 bit

188
EM_MICROBLAZE =

Tilera TILEPro

189
EM_TILEGX =

Xilinx MicroBlaze

191
EM_BPF =

Tilera TILE-Gx

247
EM_FRV =

Linux BPF - in-kernel virtual machine

0x5441
EM_AVR32 =

Fujitsu FR-V

0x18ad
EM_ALPHA =

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

0x9026
EM_CYGNUS_M32R =

Bogus old m32r magic number, used by old tools.

0x9041
EM_S390_OLD =

This is the old interim value for S/390 architecture

0xA390
EM_CYGNUS_MN10300 =

Also Panasonic/MEI MN10300, AM33

0xbeef

Class Method Summary collapse

Class Method Details

.mapping(val) ⇒ String

Return the architecture name according to val. Used by ELFFile#machine.

Only supports famous archs.

Examples:

mapping(3)
#=> 'Intel 80386'
mapping(6)
#=> 'Intel 80386'
mapping(62)
#=> 'Advanced Micro Devices X86-64'
mapping(1337)
#=> '<unknown>: 0x539'

Parameters:

  • val (Integer)

    Value of e_machine.

Returns:

  • (String)

    Name of architecture.



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# 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