return "ELF32-sparc";
case ELF::EM_WEBASSEMBLY:
return "ELF32-wasm";
+ case ELF::EM_AMDGPU:
+ return "ELF32-amdgpu";
default:
return "ELF32-unknown";
}
return "ELF64-mips";
case ELF::EM_WEBASSEMBLY:
return "ELF64-wasm";
+ case ELF::EM_AMDGPU:
+ return (EF.getHeader()->e_ident[ELF::EI_OSABI] == ELF::ELFOSABI_AMDGPU_HSA
+ && IsLittleEndian) ?
+ "ELF64-amdgpu-hsacobj" : "ELF64-amdgpu";
default:
return "ELF64-unknown";
}
default: return Triple::UnknownArch;
}
+ case ELF::EM_AMDGPU:
+ return (EF.getHeader()->e_ident[ELF::EI_CLASS] == ELF::ELFCLASS64
+ && EF.getHeader()->e_ident[ELF::EI_OSABI] == ELF::ELFOSABI_AMDGPU_HSA
+ && IsLittleEndian) ?
+ Triple::amdgcn : Triple::UnknownArch;
+
default:
return Triple::UnknownArch;
}
ECase(ELFOSABI_FENIXOS)
ECase(ELFOSABI_CLOUDABI)
ECase(ELFOSABI_C6000_ELFABI)
+ ECase(ELFOSABI_AMDGPU_HSA)
ECase(ELFOSABI_C6000_LINUX)
ECase(ELFOSABI_ARM)
ECase(ELFOSABI_STANDALONE)
# RUN: yaml2obj -format=elf %s > %t.o
# RUN: llvm-readobj -s -file-headers %t.o | FileCheck %s
+# CHECK: Format: ELF64-amdgpu-hsacobj
+# CHECK: Arch: amdgcn
# CHECK: Machine: EM_AMDGPU (0xE0)
# CHECK: Sections [
# CHECK: Section {
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_AMDGPU
+ OSABI: ELFOSABI_AMDGPU_HSA
Sections:
- Name: .shf_amdgpu
--- /dev/null
+# RUN: yaml2obj -format=elf %s > %t.o
+# RUN: llvm-readobj -s -file-headers %t.o | FileCheck %s
+
+# CHECK: Format: ELF32-amdgpu
+
+---
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_AMDGPU
--- /dev/null
+# RUN: yaml2obj -format=elf %s > %t.o
+# RUN: llvm-readobj -s -file-headers %t.o | FileCheck %s
+
+# CHECK: Format: ELF64-amdgpu
+
+---
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_AMDGPU