mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-23 19:59:57 +00:00
[AMDGPU] add AMDGPU target support to ELFObjectFile.h header
Differential Revision: http://reviews.llvm.org/D17144 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263026 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
591e1d2c57
commit
4915c55094
@ -846,6 +846,8 @@ StringRef ELFObjectFile<ELFT>::getFileFormatName() const {
|
||||
return "ELF32-sparc";
|
||||
case ELF::EM_WEBASSEMBLY:
|
||||
return "ELF32-wasm";
|
||||
case ELF::EM_AMDGPU:
|
||||
return "ELF32-amdgpu";
|
||||
default:
|
||||
return "ELF32-unknown";
|
||||
}
|
||||
@ -867,6 +869,10 @@ StringRef ELFObjectFile<ELFT>::getFileFormatName() const {
|
||||
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";
|
||||
}
|
||||
@ -923,6 +929,12 @@ unsigned ELFObjectFile<ELFT>::getArch() const {
|
||||
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;
|
||||
}
|
||||
|
@ -239,6 +239,7 @@ void ScalarEnumerationTraits<ELFYAML::ELF_ELFOSABI>::enumeration(
|
||||
ECase(ELFOSABI_FENIXOS)
|
||||
ECase(ELFOSABI_CLOUDABI)
|
||||
ECase(ELFOSABI_C6000_ELFABI)
|
||||
ECase(ELFOSABI_AMDGPU_HSA)
|
||||
ECase(ELFOSABI_C6000_LINUX)
|
||||
ECase(ELFOSABI_ARM)
|
||||
ECase(ELFOSABI_STANDALONE)
|
||||
|
@ -1,6 +1,8 @@
|
||||
# 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 {
|
||||
@ -18,6 +20,7 @@ FileHeader:
|
||||
Data: ELFDATA2LSB
|
||||
Type: ET_REL
|
||||
Machine: EM_AMDGPU
|
||||
OSABI: ELFOSABI_AMDGPU_HSA
|
||||
|
||||
Sections:
|
||||
- Name: .shf_amdgpu
|
||||
|
11
test/Object/AMDGPU/elf32-unknown.yaml
Normal file
11
test/Object/AMDGPU/elf32-unknown.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
# 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
|
11
test/Object/AMDGPU/elf64-unknown.yaml
Normal file
11
test/Object/AMDGPU/elf64-unknown.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
# 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
|
Loading…
Reference in New Issue
Block a user