Skip to content

Commit 56b6624

Browse files
authored
[BinaryFormat][ELF] Rename machine type INTEL205 to INTELGT (#159791)
`EM_INTEL205` was renamed to `EM_INTELGT` (ref [here](https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=7b9f985957798ba4dacc454f22c9e426c6897cb8)) and is used for Intel GPU images. We will be using this type for offloading to Intel GPUs. --------- Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 1d381ac commit 56b6624

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

llvm/include/llvm/BinaryFormat/ELF.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ enum {
303303
EM_BA2 = 202, // Beyond BA2 CPU architecture
304304
EM_XCORE = 203, // XMOS xCORE processor family
305305
EM_MCHP_PIC = 204, // Microchip 8-bit PIC(r) family
306-
EM_INTEL205 = 205, // Reserved by Intel
306+
EM_INTELGT = 205, // Intel Graphics Technology
307307
EM_INTEL206 = 206, // Reserved by Intel
308308
EM_INTEL207 = 207, // Reserved by Intel
309309
EM_INTEL208 = 208, // Reserved by Intel

llvm/lib/BinaryFormat/ELF.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ uint16_t ELF::convertArchNameToEMachine(StringRef Arch) {
175175
.Case("ba2", EM_BA2)
176176
.Case("xcore", EM_XCORE)
177177
.Case("mchp_pic", EM_MCHP_PIC)
178-
.Case("intel205", EM_INTEL205)
178+
.Case("intelgt", EM_INTELGT)
179179
.Case("intel206", EM_INTEL206)
180180
.Case("intel207", EM_INTEL207)
181181
.Case("intel208", EM_INTEL208)
@@ -584,8 +584,8 @@ StringRef ELF::convertEMachineToArchName(uint16_t EMachine) {
584584
return "xcore";
585585
case EM_MCHP_PIC:
586586
return "mchp_pic";
587-
case EM_INTEL205:
588-
return "intel205";
587+
case EM_INTELGT:
588+
return "intelgt";
589589
case EM_INTEL206:
590590
return "intel206";
591591
case EM_INTEL207:

llvm/lib/ObjectYAML/ELFYAML.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ void ScalarEnumerationTraits<ELFYAML::ELF_EM>::enumeration(
359359
ECase(EM_VE);
360360
ECase(EM_CSKY);
361361
ECase(EM_LOONGARCH);
362+
ECase(EM_INTELGT);
362363
#undef ECase
363364
IO.enumFallback<Hex16>(Value);
364365
}

llvm/test/tools/llvm-readobj/ELF/file-header-machine-types.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,9 @@
480480
# RUN: yaml2obj %s -o %t.ve.o -D MACHINE=EM_VE
481481
# RUN: llvm-readelf --file-headers %t.ve.o | FileCheck %s -DMACHINE="NEC SX-Aurora Vector Engine"
482482

483+
# RUN: yaml2obj %s -o %t.igt.o -D MACHINE=EM_INTELGT
484+
# RUN: llvm-readelf --file-headers %t.igt.o | FileCheck %s -DMACHINE="Intel Graphics Technology"
485+
483486
# CHECK: Machine: [[MACHINE]]
484487

485488
--- !ELF

llvm/tools/llvm-readobj/ELFDumper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,7 @@ const EnumEntry<unsigned> ElfMachineType[] = {
13051305
ENUM_ENT(EM_BPF, "EM_BPF"),
13061306
ENUM_ENT(EM_VE, "NEC SX-Aurora Vector Engine"),
13071307
ENUM_ENT(EM_LOONGARCH, "LoongArch"),
1308+
ENUM_ENT(EM_INTELGT, "Intel Graphics Technology"),
13081309
};
13091310

13101311
const EnumEntry<unsigned> ElfSymbolBindings[] = {

0 commit comments

Comments
 (0)