[llvm] r314846 - AMDGPU: Add ELFOSABI_AMDGPU_MESA3D
Konstantin Zhuravlyov via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 3 14:14:14 PDT 2017
Author: kzhuravl
Date: Tue Oct 3 14:14:14 2017
New Revision: 314846
URL: http://llvm.org/viewvc/llvm-project?rev=314846&view=rev
Log:
AMDGPU: Add ELFOSABI_AMDGPU_MESA3D
Differential Revision: https://reviews.llvm.org/D38387
Added:
llvm/trunk/test/Object/AMDGPU/elf64-amdgcn-mesa3d-definitions.yaml
Modified:
llvm/trunk/docs/AMDGPUUsage.rst
llvm/trunk/include/llvm/BinaryFormat/ELF.h
llvm/trunk/lib/ObjectYAML/ELFYAML.cpp
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
Modified: llvm/trunk/docs/AMDGPUUsage.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/AMDGPUUsage.rst?rev=314846&r1=314845&r2=314846&view=diff
==============================================================================
--- llvm/trunk/docs/AMDGPUUsage.rst (original)
+++ llvm/trunk/docs/AMDGPUUsage.rst Tue Oct 3 14:14:14 2017
@@ -365,9 +365,11 @@ The AMDGPU backend uses the following EL
``e_ident[EI_CLASS]`` ``ELFCLASS64``
``e_ident[EI_DATA]`` ``ELFDATA2LSB``
``e_ident[EI_OSABI]`` ``ELFOSABI_AMDGPU_HSA`` or
- ``ELFOSABI_AMDGPU_PAL``
+ ``ELFOSABI_AMDGPU_PAL`` or
+ ``ELFOSABI_AMDGPU_MESA3D``
``e_ident[EI_ABIVERSION]`` ``ELFABIVERSION_AMDGPU_HSA`` or
- ``ELFABIVERSION_AMDGPU_PAL``
+ ``ELFABIVERSION_AMDGPU_PAL`` or
+ ``ELFABIVERSION_AMDGPU_MESA3D``
``e_type`` ``ET_REL`` or ``ET_DYN``
``e_machine`` ``EM_AMDGPU``
``e_entry`` 0
@@ -379,15 +381,17 @@ The AMDGPU backend uses the following EL
.. table:: AMDGPU ELF Header Enumeration Values
:name: amdgpu-elf-header-enumeration-values-table
- ============================ =====
- Name Value
- ============================ =====
- ``EM_AMDGPU`` 224
- ``ELFOSABI_AMDGPU_HSA`` 64
- ``ELFOSABI_AMDGPU_PAL`` 65
- ``ELFABIVERSION_AMDGPU_HSA`` 1
- ``ELFABIVERSION_AMDGPU_PAL`` 0
- ============================ =====
+ =============================== =====
+ Name Value
+ =============================== =====
+ ``EM_AMDGPU`` 224
+ ``ELFOSABI_AMDGPU_HSA`` 64
+ ``ELFOSABI_AMDGPU_PAL`` 65
+ ``ELFOSABI_AMDGPU_MESA3D`` 66
+ ``ELFABIVERSION_AMDGPU_HSA`` 1
+ ``ELFABIVERSION_AMDGPU_PAL`` 0
+ ``ELFABIVERSION_AMDGPU_MESA3D`` 0
+ =============================== =====
``e_ident[EI_CLASS]``
The ELF class is always ``ELFCLASS64``. The AMDGPU backend only supports 64
@@ -397,7 +401,7 @@ The AMDGPU backend uses the following EL
All AMDGPU targets use ELFDATA2LSB for little-endian byte ordering.
``e_ident[EI_OSABI]``
- One of two AMD GPU architecture specific OS ABI:
+ One of the following AMD GPU architecture specific OS ABIs:
* ``ELFOSABI_AMDGPU_HSA`` is used to specify that the code object conforms to
the AMD HSA runtime ABI [HSA]_.
@@ -405,6 +409,9 @@ The AMDGPU backend uses the following EL
* ``ELFOSABI_AMDGPU_PAL`` is used to specify that the code object conforms to
the AMD PAL runtime ABI.
+ * ``ELFOSABI_AMDGPU_MESA3D`` is used to specify that the code object conforms
+ to the AMD MESA runtime ABI.
+
``e_ident[EI_ABIVERSION]``
The ABI version of the AMD GPU architecture specific OS ABI to which the code
object conforms:
@@ -415,6 +422,9 @@ The AMDGPU backend uses the following EL
* ``ELFABIVERSION_AMDGPU_PAL`` is used to specify the version of AMD PAL
runtime ABI.
+ * ``ELFABIVERSION_AMDGPU_MESA3D`` is used to specify the version of AMD MESA
+ runtime ABI.
+
``e_type``
Can be one of the following values:
Modified: llvm/trunk/include/llvm/BinaryFormat/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BinaryFormat/ELF.h?rev=314846&r1=314845&r2=314846&view=diff
==============================================================================
--- llvm/trunk/include/llvm/BinaryFormat/ELF.h (original)
+++ llvm/trunk/include/llvm/BinaryFormat/ELF.h Tue Oct 3 14:14:14 2017
@@ -335,32 +335,33 @@ enum {
// OS ABI identification.
enum {
- ELFOSABI_NONE = 0, // UNIX System V ABI
- ELFOSABI_HPUX = 1, // HP-UX operating system
- ELFOSABI_NETBSD = 2, // NetBSD
- ELFOSABI_GNU = 3, // GNU/Linux
- ELFOSABI_LINUX = 3, // Historical alias for ELFOSABI_GNU.
- ELFOSABI_HURD = 4, // GNU/Hurd
- ELFOSABI_SOLARIS = 6, // Solaris
- ELFOSABI_AIX = 7, // AIX
- ELFOSABI_IRIX = 8, // IRIX
- ELFOSABI_FREEBSD = 9, // FreeBSD
- ELFOSABI_TRU64 = 10, // TRU64 UNIX
- ELFOSABI_MODESTO = 11, // Novell Modesto
- ELFOSABI_OPENBSD = 12, // OpenBSD
- ELFOSABI_OPENVMS = 13, // OpenVMS
- ELFOSABI_NSK = 14, // Hewlett-Packard Non-Stop Kernel
- ELFOSABI_AROS = 15, // AROS
- ELFOSABI_FENIXOS = 16, // FenixOS
- ELFOSABI_CLOUDABI = 17, // Nuxi CloudABI
- ELFOSABI_FIRST_ARCH = 64, // First architecture-specific OS ABI
- ELFOSABI_AMDGPU_HSA = 64, // AMD HSA runtime
- ELFOSABI_AMDGPU_PAL = 65, // AMD PAL runtime
- ELFOSABI_ARM = 97, // ARM
- ELFOSABI_C6000_ELFABI = 64, // Bare-metal TMS320C6000
- ELFOSABI_C6000_LINUX = 65, // Linux TMS320C6000
- ELFOSABI_STANDALONE = 255, // Standalone (embedded) application
- ELFOSABI_LAST_ARCH = 255 // Last Architecture-specific OS ABI
+ ELFOSABI_NONE = 0, // UNIX System V ABI
+ ELFOSABI_HPUX = 1, // HP-UX operating system
+ ELFOSABI_NETBSD = 2, // NetBSD
+ ELFOSABI_GNU = 3, // GNU/Linux
+ ELFOSABI_LINUX = 3, // Historical alias for ELFOSABI_GNU.
+ ELFOSABI_HURD = 4, // GNU/Hurd
+ ELFOSABI_SOLARIS = 6, // Solaris
+ ELFOSABI_AIX = 7, // AIX
+ ELFOSABI_IRIX = 8, // IRIX
+ ELFOSABI_FREEBSD = 9, // FreeBSD
+ ELFOSABI_TRU64 = 10, // TRU64 UNIX
+ ELFOSABI_MODESTO = 11, // Novell Modesto
+ ELFOSABI_OPENBSD = 12, // OpenBSD
+ ELFOSABI_OPENVMS = 13, // OpenVMS
+ ELFOSABI_NSK = 14, // Hewlett-Packard Non-Stop Kernel
+ ELFOSABI_AROS = 15, // AROS
+ ELFOSABI_FENIXOS = 16, // FenixOS
+ ELFOSABI_CLOUDABI = 17, // Nuxi CloudABI
+ ELFOSABI_FIRST_ARCH = 64, // First architecture-specific OS ABI
+ ELFOSABI_AMDGPU_HSA = 64, // AMD HSA runtime
+ ELFOSABI_AMDGPU_PAL = 65, // AMD PAL runtime
+ ELFOSABI_AMDGPU_MESA3D = 66, // AMD GCN GPUs (GFX6+) for MESA runtime
+ ELFOSABI_ARM = 97, // ARM
+ ELFOSABI_C6000_ELFABI = 64, // Bare-metal TMS320C6000
+ ELFOSABI_C6000_LINUX = 65, // Linux TMS320C6000
+ ELFOSABI_STANDALONE = 255, // Standalone (embedded) application
+ ELFOSABI_LAST_ARCH = 255 // Last Architecture-specific OS ABI
};
#define ELF_RELOC(name, value) name = value,
Modified: llvm/trunk/lib/ObjectYAML/ELFYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/ELFYAML.cpp?rev=314846&r1=314845&r2=314846&view=diff
==============================================================================
--- llvm/trunk/lib/ObjectYAML/ELFYAML.cpp (original)
+++ llvm/trunk/lib/ObjectYAML/ELFYAML.cpp Tue Oct 3 14:14:14 2017
@@ -262,6 +262,7 @@ void ScalarEnumerationTraits<ELFYAML::EL
ECase(ELFOSABI_CLOUDABI);
ECase(ELFOSABI_AMDGPU_HSA);
ECase(ELFOSABI_AMDGPU_PAL);
+ ECase(ELFOSABI_AMDGPU_MESA3D);
ECase(ELFOSABI_ARM);
ECase(ELFOSABI_C6000_ELFABI);
ECase(ELFOSABI_C6000_LINUX);
Added: llvm/trunk/test/Object/AMDGPU/elf64-amdgcn-mesa3d-definitions.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/AMDGPU/elf64-amdgcn-mesa3d-definitions.yaml?rev=314846&view=auto
==============================================================================
--- llvm/trunk/test/Object/AMDGPU/elf64-amdgcn-mesa3d-definitions.yaml (added)
+++ llvm/trunk/test/Object/AMDGPU/elf64-amdgcn-mesa3d-definitions.yaml Tue Oct 3 14:14:14 2017
@@ -0,0 +1,21 @@
+# RUN: yaml2obj %s > %t.o
+# RUN: llvm-readobj -s -file-headers %t.o | FileCheck %s
+
+# CHECK: Format: ELF64-amdgpu
+# CHECK: Arch: amdgcn
+# CHECK: ElfHeader {
+# CHECK: Ident {
+# CHECK: OS/ABI: AMDGPU_MESA3D (0x42)
+# CHECK: ABIVersion: 0
+# CHECK: }
+# CHECK: Machine: EM_AMDGPU (0xE0)
+# CHECK: }
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_AMDGPU
+ OSABI: ELFOSABI_AMDGPU_MESA3D
+...
Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=314846&r1=314845&r2=314846&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Tue Oct 3 14:14:14 2017
@@ -825,8 +825,9 @@ static const EnumEntry<unsigned> ElfOSAB
};
static const EnumEntry<unsigned> AMDGPUElfOSABI[] = {
- {"AMDGPU_HSA", "AMDGPU - HSA", ELF::ELFOSABI_AMDGPU_HSA},
- {"AMDGPU_PAL", "AMDGPU - PAL", ELF::ELFOSABI_AMDGPU_PAL}
+ {"AMDGPU_HSA", "AMDGPU - HSA", ELF::ELFOSABI_AMDGPU_HSA},
+ {"AMDGPU_PAL", "AMDGPU - PAL", ELF::ELFOSABI_AMDGPU_PAL},
+ {"AMDGPU_MESA3D", "AMDGPU - MESA3D", ELF::ELFOSABI_AMDGPU_MESA3D}
};
static const EnumEntry<unsigned> ARMElfOSABI[] = {
More information about the llvm-commits
mailing list