[PATCH] D86341: [llvm-readobj/elf][test] - Add testing for EM_* specific OS/ABI values.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 04:42:05 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGcbedbd12e983: [llvm-readobj/elf][test] - Add testing for EM_* specific OS/ABI values. (authored by grimar).
Changed prior to commit:
https://reviews.llvm.org/D86341?vs=287001&id=287927#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86341/new/
https://reviews.llvm.org/D86341
Files:
llvm/test/tools/llvm-readobj/ELF/Inputs/trivial.obj.elf-amdhsa-gfx803
llvm/test/tools/llvm-readobj/ELF/file-header-os-abi.test
llvm/tools/llvm-readobj/ELFDumper.cpp
Index: llvm/tools/llvm-readobj/ELFDumper.cpp
===================================================================
--- llvm/tools/llvm-readobj/ELFDumper.cpp
+++ llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -1320,11 +1320,6 @@
{"Standalone", "Standalone App", ELF::ELFOSABI_STANDALONE}
};
-static const EnumEntry<unsigned> SymVersionFlags[] = {
- {"Base", "BASE", VER_FLG_BASE},
- {"Weak", "WEAK", VER_FLG_WEAK},
- {"Info", "INFO", VER_FLG_INFO}};
-
static const EnumEntry<unsigned> AMDGPUElfOSABI[] = {
{"AMDGPU_HSA", "AMDGPU - HSA", ELF::ELFOSABI_AMDGPU_HSA},
{"AMDGPU_PAL", "AMDGPU - PAL", ELF::ELFOSABI_AMDGPU_PAL},
@@ -6566,6 +6561,11 @@
}
}
+static const EnumEntry<unsigned> SymVersionFlags[] = {
+ {"Base", "BASE", VER_FLG_BASE},
+ {"Weak", "WEAK", VER_FLG_WEAK},
+ {"Info", "INFO", VER_FLG_INFO}};
+
template <class ELFT>
void LLVMStyle<ELFT>::printVersionDefinitionSection(const ELFFile<ELFT> *Obj,
const Elf_Shdr *Sec) {
Index: llvm/test/tools/llvm-readobj/ELF/file-header-os-abi.test
===================================================================
--- llvm/test/tools/llvm-readobj/ELF/file-header-os-abi.test
+++ llvm/test/tools/llvm-readobj/ELF/file-header-os-abi.test
@@ -10,10 +10,11 @@
--- !ELF
FileHeader:
- Class: ELFCLASS64
- Data: ELFDATA2LSB
- Type: ET_REL
- OSABI: [[OSABI]]
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: [[MACHINE=<none>]]
+ OSABI: [[OSABI]]
## EI_OSABI is set to ELFOSABI_HPUX.
# RUN: yaml2obj %s -DOSABI=ELFOSABI_HPUX -o %t.osabi.hpux
@@ -158,3 +159,51 @@
# OSABI-UNKNOWN-LLVM: OS/ABI: 0xFE
# OSABI-UNKNOWN-GNU: OS/ABI: fe
+
+## Check all EM_AMDGPU specific values.
+
+# RUN: yaml2obj %s -DOSABI=ELFOSABI_AMDGPU_HSA -DMACHINE=EM_AMDGPU -o %t.osabi.amd.hsa
+# RUN: llvm-readobj --file-headers %t.osabi.amd.hsa | FileCheck %s --match-full-lines --check-prefix=OSABI-AMDHSA-LLVM
+# RUN: llvm-readelf --file-headers %t.osabi.amd.hsa | FileCheck %s --match-full-lines --check-prefix=OSABI-AMDHSA-GNU
+
+# OSABI-AMDHSA-LLVM: OS/ABI: AMDGPU_HSA (0x40)
+# OSABI-AMDHSA-GNU: OS/ABI: 40
+
+# RUN: yaml2obj %s -DOSABI=ELFOSABI_AMDGPU_PAL -DMACHINE=EM_AMDGPU -o %t.osabi.amd.pal
+# RUN: llvm-readobj --file-headers %t.osabi.amd.pal | FileCheck %s --match-full-lines --check-prefix=OSABI-AMDPAL-LLVM
+# RUN: llvm-readelf --file-headers %t.osabi.amd.pal | FileCheck %s --match-full-lines --check-prefix=OSABI-AMDPAL-GNU
+
+# OSABI-AMDPAL-LLVM: OS/ABI: AMDGPU_PAL (0x41)
+# OSABI-AMDPAL-GNU: OS/ABI: 41
+
+# RUN: yaml2obj %s -DOSABI=ELFOSABI_AMDGPU_MESA3D -DMACHINE=EM_AMDGPU -o %t.osabi.amd.mesa3d
+# RUN: llvm-readobj --file-headers %t.osabi.amd.mesa3d | FileCheck %s --match-full-lines --check-prefix=OSABI-AMDMESA3D-LLVM
+# RUN: llvm-readelf --file-headers %t.osabi.amd.mesa3d | FileCheck %s --match-full-lines --check-prefix=OSABI-AMDMESA3D-GNU
+
+# OSABI-AMDMESA3D-LLVM: OS/ABI: AMDGPU_MESA3D (0x42)
+# OSABI-AMDMESA3D-GNU: OS/ABI: 42
+
+# Check all EM_ARM specific values.
+
+# RUN: yaml2obj %s -DOSABI=ELFOSABI_ARM -DMACHINE=EM_ARM -o %t.osabi.arm
+# RUN: llvm-readobj --file-headers %t.osabi.arm | FileCheck %s --match-full-lines --check-prefix=OSABI-ARM-LLVM
+# RUN: llvm-readelf --file-headers %t.osabi.arm | FileCheck %s --match-full-lines --check-prefix=OSABI-ARM-GNU
+
+# OSABI-ARM-LLVM: OS/ABI: ARM (0x61)
+# OSABI-ARM-GNU: OS/ABI: 61
+
+## Check all EM_TI_C6000 specific values.
+
+# RUN: yaml2obj %s -DOSABI=ELFOSABI_C6000_ELFABI -DMACHINE=EM_TI_C6000 -o %t.osabi.c6000.elfabi
+# RUN: llvm-readobj --file-headers %t.osabi.c6000.elfabi | FileCheck %s --match-full-lines --check-prefix=OSABI-C6000ELFABI-LLVM
+# RUN: llvm-readelf --file-headers %t.osabi.c6000.elfabi | FileCheck %s --match-full-lines --check-prefix=OSABI-C6000ELFABI-GNU
+
+# OSABI-C6000ELFABI-LLVM: OS/ABI: C6000_ELFABI (0x40)
+# OSABI-C6000ELFABI-GNU: OS/ABI: 40
+
+# RUN: yaml2obj %s -DOSABI=ELFOSABI_C6000_LINUX -DMACHINE=EM_TI_C6000 -o %t.osabi.c6000.linux
+# RUN: llvm-readobj --file-headers %t.osabi.c6000.linux | FileCheck %s --match-full-lines --check-prefix=OSABI-C6000LINUX-LLVM
+# RUN: llvm-readelf --file-headers %t.osabi.c6000.linux | FileCheck %s --match-full-lines --check-prefix=OSABI-C6000LINUX-GNU
+
+# OSABI-C6000LINUX-LLVM: OS/ABI: C6000_LINUX (0x41)
+# OSABI-C6000LINUX-GNU: OS/ABI: 41
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86341.287927.patch
Type: text/x-patch
Size: 4384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200826/528712d2/attachment.bin>
More information about the llvm-commits
mailing list