dynamic-section-raw-content.yaml
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
## Show that yaml2obj can handle a dynamic section with raw content instead of
## entries. Also show that it rejects raw content when entries are also provided.
# RUN: yaml2obj --docnum=1 %s -o %t1
# RUN: llvm-readobj -x .dynamic --sections %t1 | FileCheck %s --check-prefix=RAW
# RAW: Name: .dynamic
# RAW-NEXT: Type: SHT_DYNAMIC
# RAW-NEXT: Flags [
# RAW-NEXT: ]
# RAW-NEXT: Address:
# RAW-NEXT: Offset:
# RAW-NEXT: Size: 16
# RAW: Hex dump of section '.dynamic':
# RAW-NEXT: 0x00000000 01234567 89012345 67890000 00000000 {{.*}}
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Sections:
- Name: .dynamic
Type: SHT_DYNAMIC
Content: "01234567890123456789000000000000"
# RUN: not yaml2obj --docnum=2 %s 2>&1 | FileCheck %s --check-prefix=ERR
# ERR: cannot specify both raw content and explicit entries for dynamic section '.dynamic1'
# ERR: cannot specify both raw content and explicit entries for dynamic section '.dynamic2'
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Sections:
- Name: .dynamic1
Type: SHT_DYNAMIC
Content: "0123456789"
Entries:
- Tag: DT_STRSZ
Value: 0
- Name: .dynamic2
Type: SHT_DYNAMIC
Content: "0123456789"
Entries:
- Tag: DT_STRSZ
Value: 0