Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[yaml2obj][test] - Ensure that dynamic section has sh_entsize correct…
…ly set. This updates the existent test because it lacks coverage. Differential revision: https://reviews.llvm.org/D76226
- Loading branch information
Georgii Rymar
committed
Mar 17, 2020
1 parent
5156e38
commit fe134b6
Showing
1 changed file
with
21 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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{{$}} |