llvm.org GIT mirror llvm / d40b451
AMDGPU/SI: Set ELF OS/ABI to ELFOSABI_AMDGPU_HSA Reviewers: arsenm, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10708 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240832 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 4 years ago
4 changed file(s) with 11 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
346346 ELFOSABI_FENIXOS = 16, // FenixOS
347347 ELFOSABI_CLOUDABI = 17, // Nuxi CloudABI
348348 ELFOSABI_C6000_ELFABI = 64, // Bare-metal TMS320C6000
349 ELFOSABI_AMDGPU_HSA = 64, // AMD HSA runtime
349350 ELFOSABI_C6000_LINUX = 65, // Linux TMS320C6000
350351 ELFOSABI_ARM = 97, // ARM
351352 ELFOSABI_STANDALONE = 255 // Standalone (embedded) application
3030 } // End anonymous namespace
3131
3232 AMDGPUELFObjectWriter::AMDGPUELFObjectWriter(bool Is64Bit)
33 : MCELFObjectTargetWriter(Is64Bit, 0, ELF::EM_AMDGPU, false) { }
33 : MCELFObjectTargetWriter(Is64Bit, ELF::ELFOSABI_AMDGPU_HSA,
34 ELF::EM_AMDGPU, false) { }
3435
3536 MCObjectWriter *llvm::createAMDGPUELFObjectWriter(bool Is64Bit, raw_pwrite_stream &OS) {
3637 MCELFObjectTargetWriter *MOTW = new AMDGPUELFObjectWriter(Is64Bit);
88 ; RUN: llc < %s -mtriple=amdgcn-pc-mingw -mcpu=SI -verify-machineinstrs -filetype=obj | llvm-readobj -s -symbols -file-headers - | FileCheck --check-prefix=ELF %s
99
1010 ; ELF: Format: ELF64
11 ; ELF: OS/ABI: AMDGPU_HSA (0x40)
1112 ; ELF: Machine: EM_AMDGPU (0xE0)
1213 ; ELF: Name: .AMDGPU.config
1314 ; ELF: Type: SHT_PROGBITS
573573 W.printEnum ("DataEncoding", Header->e_ident[ELF::EI_DATA],
574574 makeArrayRef(ElfDataEncoding));
575575 W.printNumber("FileVersion", Header->e_ident[ELF::EI_VERSION]);
576 W.printEnum ("OS/ABI", Header->e_ident[ELF::EI_OSABI],
576
577 // Handle architecture specific OS/ABI values.
578 if (Header->e_machine == ELF::EM_AMDGPU &&
579 Header->e_ident[ELF::EI_OSABI] == ELF::ELFOSABI_AMDGPU_HSA)
580 W.printHex("OS/ABI", "AMDGPU_HSA", ELF::ELFOSABI_AMDGPU_HSA);
581 else
582 W.printEnum ("OS/ABI", Header->e_ident[ELF::EI_OSABI],
577583 makeArrayRef(ElfOSABI));
578584 W.printNumber("ABIVersion", Header->e_ident[ELF::EI_ABIVERSION]);
579585 W.printBinary("Unused", makeArrayRef(Header->e_ident).slice(ELF::EI_PAD));