[PATCH] AMDGPU/SI: Set ELF OS/ABI to ELFOSABI_AMDGPU_HSA
Rafael EspĂndola
rafael.espindola at gmail.com
Wed Jun 24 13:39:50 PDT 2015
Please put the value in include/Support/ELF.h and fix llvm-readobj to
know the value is architecture dependent.
Cheers,
Rafael
On 24 June 2015 at 16:33, Tom Stellard <thomas.stellard at amd.com> wrote:
> Hi arsenm, rafael,
>
> http://reviews.llvm.org/D10708
>
> Files:
> lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp
> test/CodeGen/AMDGPU/elf.ll
>
> Index: lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp
> ===================================================================
> --- lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp
> +++ lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp
> @@ -30,8 +30,10 @@
>
> } // End anonymous namespace
>
> +#define ELFOSABI_AMDGPU_HSA 64
> +
> AMDGPUELFObjectWriter::AMDGPUELFObjectWriter(bool Is64Bit)
> - : MCELFObjectTargetWriter(Is64Bit, 0, ELF::EM_AMDGPU, false) { }
> + : MCELFObjectTargetWriter(Is64Bit, ELFOSABI_AMDGPU_HSA, ELF::EM_AMDGPU, false) { }
>
> MCObjectWriter *llvm::createAMDGPUELFObjectWriter(bool Is64Bit, raw_pwrite_stream &OS) {
> MCELFObjectTargetWriter *MOTW = new AMDGPUELFObjectWriter(Is64Bit);
> Index: test/CodeGen/AMDGPU/elf.ll
> ===================================================================
> --- test/CodeGen/AMDGPU/elf.ll
> +++ test/CodeGen/AMDGPU/elf.ll
> @@ -9,6 +9,8 @@
> ; RUN: llc < %s -mtriple=amdgcn-pc-mingw -mcpu=SI -verify-machineinstrs -filetype=obj | llvm-readobj -s -symbols -file-headers - | FileCheck --check-prefix=ELF %s
>
> ; ELF: Format: ELF64
> +; 0x40 is machine dependent, but llvm defines it as C600_ELFABI.
> +; ELF: OS/ABI: C6000_ELFABI (0x40)
> ; ELF: Machine: EM_AMDGPU (0xE0)
> ; ELF: Name: .AMDGPU.config
> ; ELF: Type: SHT_PROGBITS
>
> EMAIL PREFERENCES
> http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list