2 #------------------------------------------------------------------------------
3 # elf: file(1) magic for ELF executables
5 # We have to check the byte order flag to see what byte order all the
6 # other stuff in the header is in.
8 # What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
10 # updated by Daniel Quinlan (quinlan@yggdrasil.com)
12 >4 byte 0 invalid class
14 # only for MIPS - in the future, the ABI field of e_flags should be used.
17 >>>36 belong &0x20 N32
19 >5 byte 0 invalid byte order
21 # The official e_machine number for MIPS is now #8, regardless of endianness.
22 # The second number (#10) will be deprecated later. For now, we still
23 # say something if #10 is encountered, but only gory details for #8.
27 >>>>36 lelong&0xf0000000 0x00000000 MIPS-I
28 >>>>36 lelong&0xf0000000 0x10000000 MIPS-II
29 >>>>36 lelong&0xf0000000 0x20000000 MIPS-III
30 >>>>36 lelong&0xf0000000 0x30000000 MIPS-IV
31 >>>>36 lelong&0xf0000000 0x40000000 MIPS-V
32 >>>>36 lelong&0xf0000000 0x60000000 MIPS32
33 >>>>36 lelong&0xf0000000 0x70000000 MIPS64
34 >>>>36 lelong&0xf0000000 0x80000000 MIPS32 rel2
35 >>>>36 lelong&0xf0000000 0x90000000 MIPS64 rel2
38 >>>>48 lelong&0xf0000000 0x00000000 MIPS-I
39 >>>>48 lelong&0xf0000000 0x10000000 MIPS-II
40 >>>>48 lelong&0xf0000000 0x20000000 MIPS-III
41 >>>>48 lelong&0xf0000000 0x30000000 MIPS-IV
42 >>>>48 lelong&0xf0000000 0x40000000 MIPS-V
43 >>>>48 lelong&0xf0000000 0x60000000 MIPS32
44 >>>>48 lelong&0xf0000000 0x70000000 MIPS64
45 >>>>48 lelong&0xf0000000 0x80000000 MIPS32 rel2
46 >>>>48 lelong&0xf0000000 0x90000000 MIPS64 rel2
47 >>16 leshort 0 no file type,
48 >>16 leshort 1 relocatable,
49 >>16 leshort 2 executable,
50 >>16 leshort 3 shared object,
51 # Core handling from Peter Tobias <tobias@server.et-inf.fho-emden.de>
52 # corrections by Christian 'Dr. Disk' Hechelmann <drdisk@ds9.au.s.shuttle.de>
53 >>16 leshort 4 core file
54 # Core file detection is not reliable.
55 #>>>(0x38+0xcc) string >\0 of '%s'
56 #>>>(0x38+0x10) lelong >0 (signal %d),
57 >>16 leshort &0xff00 processor-specific,
58 >>18 leshort 0 no machine,
59 >>18 leshort 1 AT&T WE32100 - invalid byte order,
60 >>18 leshort 2 SPARC - invalid byte order,
61 >>18 leshort 3 Intel 80386,
62 >>18 leshort 4 Motorola
63 >>>36 lelong &0x01000000 68000 - invalid byte order,
64 >>>36 lelong &0x00810000 CPU32 - invalid byte order,
65 >>>36 lelong 0 68020 - invalid byte order,
66 >>18 leshort 5 Motorola 88000 - invalid byte order,
67 >>18 leshort 6 Intel 80486,
68 >>18 leshort 7 Intel 80860,
70 >>18 leshort 9 Amdahl - invalid byte order,
71 >>18 leshort 10 MIPS (deprecated),
72 >>18 leshort 11 RS6000 - invalid byte order,
73 >>18 leshort 15 PA-RISC - invalid byte order,
74 >>>50 leshort 0x0214 2.0
75 >>>48 leshort &0x0008 (LP64),
76 >>18 leshort 16 nCUBE,
77 >>18 leshort 17 Fujitsu VPP500,
78 >>18 leshort 18 SPARC32PLUS,
79 >>18 leshort 20 PowerPC,
80 >>18 leshort 36 NEC V800,
81 >>18 leshort 37 Fujitsu FR20,
82 >>18 leshort 38 TRW RH-32,
83 >>18 leshort 39 Motorola RCE,
85 >>18 leshort 41 Alpha,
86 >>18 leshort 42 Hitachi SH,
87 >>18 leshort 43 SPARC V9 - invalid byte order,
88 >>18 leshort 44 Siemens Tricore Embedded Processor,
89 >>18 leshort 45 Argonaut RISC Core, Argonaut Technologies Inc.,
90 >>18 leshort 46 Hitachi H8/300,
91 >>18 leshort 47 Hitachi H8/300H,
92 >>18 leshort 48 Hitachi H8S,
93 >>18 leshort 49 Hitachi H8/500,
94 >>18 leshort 50 IA-64 (Intel 64 bit architecture)
95 >>18 leshort 51 Stanford MIPS-X,
96 >>18 leshort 52 Motorola Coldfire,
97 >>18 leshort 53 Motorola M68HC12,
98 >>18 leshort 62 AMD x86-64,
99 >>18 leshort 75 Digital VAX,
100 >>18 leshort 97 NatSemi 32k,
101 >>18 leshort 0x9026 Alpha (unofficial),
102 >>20 lelong 0 invalid version
103 >>20 lelong 1 version 1
104 >>36 lelong 1 MathCoPro/FPU/MAU Required
106 # only for MIPS - see comment in little-endian section above.
110 >>>>36 belong&0xf0000000 0x00000000 MIPS-I
111 >>>>36 belong&0xf0000000 0x10000000 MIPS-II
112 >>>>36 belong&0xf0000000 0x20000000 MIPS-III
113 >>>>36 belong&0xf0000000 0x30000000 MIPS-IV
114 >>>>36 belong&0xf0000000 0x40000000 MIPS-V
115 >>>>36 belong&0xf0000000 0x60000000 MIPS32
116 >>>>36 belong&0xf0000000 0x70000000 MIPS64
117 >>>>36 belong&0xf0000000 0x80000000 MIPS32 rel2
118 >>>>36 belong&0xf0000000 0x90000000 MIPS64 rel2
121 >>>>48 belong&0xf0000000 0x00000000 MIPS-I
122 >>>>48 belong&0xf0000000 0x10000000 MIPS-II
123 >>>>48 belong&0xf0000000 0x20000000 MIPS-III
124 >>>>48 belong&0xf0000000 0x30000000 MIPS-IV
125 >>>>48 belong&0xf0000000 0x40000000 MIPS-V
126 >>>>48 belong&0xf0000000 0x60000000 MIPS32
127 >>>>48 belong&0xf0000000 0x70000000 MIPS64
128 >>>>48 belong&0xf0000000 0x80000000 MIPS32 rel2
129 >>>>48 belong&0xf0000000 0x90000000 MIPS64 rel2
130 >>16 beshort 0 no file type,
131 >>16 beshort 1 relocatable,
132 >>16 beshort 2 executable,
133 >>16 beshort 3 shared object,
134 >>16 beshort 4 core file,
135 #>>>(0x38+0xcc) string >\0 of '%s'
136 #>>>(0x38+0x10) belong >0 (signal %d),
137 >>16 beshort &0xff00 processor-specific,
138 >>18 beshort 0 no machine,
139 >>18 beshort 1 AT&T WE32100,
140 >>18 beshort 2 SPARC,
141 >>18 beshort 3 Intel 80386 - invalid byte order,
142 >>18 beshort 4 Motorola
143 >>>36 belong &0x01000000 68000,
144 >>>36 belong &0x00810000 CPU32,
145 >>>36 belong 0 68020,
146 >>18 beshort 5 Motorola 88000,
147 >>18 beshort 6 Intel 80486 - invalid byte order,
148 >>18 beshort 7 Intel 80860,
150 >>18 beshort 9 Amdahl,
151 >>18 beshort 10 MIPS (deprecated),
152 >>18 beshort 11 RS6000,
153 >>18 beshort 15 PA-RISC
154 >>>50 beshort 0x0214 2.0
155 >>>48 beshort &0x0008 (LP64)
156 >>18 beshort 16 nCUBE,
157 >>18 beshort 17 Fujitsu VPP500,
158 >>18 beshort 18 SPARC32PLUS,
159 >>>36 belong&0xffff00 &0x000100 V8+ Required,
160 >>>36 belong&0xffff00 &0x000200 Sun UltraSPARC1 Extensions Required,
161 >>>36 belong&0xffff00 &0x000400 HaL R1 Extensions Required,
162 >>>36 belong&0xffff00 &0x000800 Sun UltraSPARC3 Extensions Required,
163 >>18 beshort 20 PowerPC or cisco 4500,
164 >>18 beshort 21 cisco 7500,
165 >>18 beshort 24 cisco SVIP,
166 >>18 beshort 25 cisco 7200,
167 >>18 beshort 36 NEC V800 or cisco 12000,
168 >>18 beshort 37 Fujitsu FR20,
169 >>18 beshort 38 TRW RH-32,
170 >>18 beshort 39 Motorola RCE,
172 >>18 beshort 41 Alpha,
173 >>18 beshort 42 Hitachi SH,
174 >>18 beshort 43 SPARC V9,
175 >>18 beshort 44 Siemens Tricore Embedded Processor,
176 >>18 beshort 45 Argonaut RISC Core, Argonaut Technologies Inc.,
177 >>18 beshort 46 Hitachi H8/300,
178 >>18 beshort 47 Hitachi H8/300H,
179 >>18 beshort 48 Hitachi H8S,
180 >>18 beshort 49 Hitachi H8/500,
181 >>18 beshort 50 Intel Merced Processor,
182 >>18 beshort 51 Stanford MIPS-X,
183 >>18 beshort 52 Motorola Coldfire,
184 >>18 beshort 53 Motorola M68HC12,
185 >>18 beshort 73 Cray NV1,
186 >>18 beshort 75 Digital VAX,
187 >>18 beshort 97 NatSemi 32k,
188 >>18 beshort 0x9026 Alpha (unofficial),
189 >>20 belong 0 invalid version
190 >>20 belong 1 version 1
191 >>36 belong 1 MathCoPro/FPU/MAU Required
197 >>7 byte 3 (GNU/Linux)
198 >>7 byte 4 (GNU/Hurd)
201 >>7 byte 7 (Monterey)
205 >>7 byte 11 (Novell Modesto)
206 >>7 byte 12 (OpenBSD)
208 >>7 byte 255 (embedded)