[llvm] fe134b6 - [yaml2obj][test] - Ensure that dynamic section has sh_entsize correctly set.
Georgii Rymar via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 17 03:32:16 PDT 2020
Author: Georgii Rymar
Date: 2020-03-17T13:32:01+03:00
New Revision: fe134b661b9f16a8816453245006d93062873404
URL: https://github.com/llvm/llvm-project/commit/fe134b661b9f16a8816453245006d93062873404
DIFF: https://github.com/llvm/llvm-project/commit/fe134b661b9f16a8816453245006d93062873404.diff
LOG: [yaml2obj][test] - Ensure that dynamic section has sh_entsize correctly set.
This updates the existent test because it lacks coverage.
Differential revision: https://reviews.llvm.org/D76226
Added:
Modified:
llvm/test/tools/yaml2obj/ELF/dynamic-section.yaml
Removed:
################################################################################
diff --git a/llvm/test/tools/yaml2obj/ELF/dynamic-section.yaml b/llvm/test/tools/yaml2obj/ELF/dynamic-section.yaml
index 035d97094dfe..9dadf63b16f0 100644
--- a/llvm/test/tools/yaml2obj/ELF/dynamic-section.yaml
+++ b/llvm/test/tools/yaml2obj/ELF/dynamic-section.yaml
@@ -1,18 +1,29 @@
## Ensures that dynamic section has sh_entsize correctly set.
-# RUN: yaml2obj %s -o %t
-# RUN: llvm-readobj --sections %t | FileCheck %s --check-prefix=SECTION
+# RUN: yaml2obj -DBITS=64 %s -o %t.64
+# RUN: llvm-readobj --sections %t.64 | FileCheck %s -DENTSIZE=16
+# RUN: yaml2obj -DBITS=32 %s -o %t.32
+# RUN: llvm-readobj --sections %t.32 | FileCheck %s -DENTSIZE=8
!ELF
FileHeader:
- Class: ELFCLASS64
- Data: ELFDATA2LSB
- Type: ET_DYN
- Machine: EM_X86_64
+ Class: ELFCLASS[[BITS]]
+ Data: ELFDATA2LSB
+ Type: ET_DYN
+ Machine: EM_X86_64
Sections:
- - Name: .dynamic
- Type: SHT_DYNAMIC
+## Test default values set by yaml2obj.
+ - Name: .dynamic
+ Type: SHT_DYNAMIC
Flags: [ SHF_ALLOC, SHF_WRITE ]
+## Test we can use an arbitrary value for sh_entsize.
+ - Name: .mydynamic
+ Type: SHT_DYNAMIC
+ EntSize: 0xFE
-# SECTION: Name: .dynamic
-# SECTION: EntrySize: 16
+# CHECK: Name: .dynamic
+# CHECK: EntrySize:
+# CHECK-SAME: {{^}} [[ENTSIZE]]{{$}}
+# CHECK: Name: .mydynamic
+# CHECK: EntrySize:
+# CHECK-SAME: {{^}} 254{{$}}
More information about the llvm-commits
mailing list