relr-section.yaml
2.65 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
## Test how we dump SHT_RELR sections for 32 and 64-bit targets.
## Test we use the "Entries" property when it is possible to
## dump values correctly. Also, check we do not dump sh_entsize when
## it has the default value.
# RUN: yaml2obj --docnum=1 -D BITS=32 -D ENCODE=LSB %s -o %t.32le
# RUN: obj2yaml %t.32le | FileCheck %s --check-prefix=ELF32LE
# RUN: yaml2obj --docnum=1 -D BITS=32 -D ENCODE=MSB %s -o %t.32be
# RUN: obj2yaml %t.32be | FileCheck %s --check-prefix=ELF32BE
# RUN: yaml2obj --docnum=1 -D BITS=64 -D ENCODE=LSB %s -o %t.64le
# RUN: obj2yaml %t.64le | FileCheck %s --check-prefix=ELF64LE
# RUN: yaml2obj --docnum=1 -D BITS=64 -D ENCODE=MSB %s -o %t.64be
# RUN: obj2yaml %t.64be | FileCheck %s --check-prefix=ELF64BE
# ELF64LE: Sections:
# ELF64LE-NEXT: - Name: .relr.dyn
# ELF64LE-NEXT: Type: SHT_RELR
# ELF64LE-NEXT: Entries: [ 0x8877665544332211 ]
# ELF32LE: Sections:
# ELF32LE-NEXT: - Name: .relr.dyn
# ELF32LE-NEXT: Type: SHT_RELR
# ELF32LE-NEXT: Entries: [ 0x0000000044332211, 0x0000000088776655 ]
# ELF64BE: Sections:
# ELF64BE-NEXT: - Name: .relr.dyn
# ELF64BE-NEXT: Type: SHT_RELR
# ELF64BE-NEXT: Entries: [ 0x1122334455667788 ]
# ELF32BE: Sections:
# ELF32BE-NEXT: - Name: .relr.dyn
# ELF32BE-NEXT: Type: SHT_RELR
# ELF32BE-NEXT: Entries: [ 0x0000000011223344, 0x0000000055667788 ]
--- !ELF
FileHeader:
Class: ELFCLASS[[BITS]]
Data: ELFDATA2[[ENCODE]]
Type: ET_DYN
Sections:
- Name: .relr.dyn
Type: SHT_RELR
Content: "1122334455667788"
## Test we use the "Content" property when a SHT_RELR section is truncated.
# RUN: yaml2obj --docnum=2 %s -o %t.content
# RUN: obj2yaml %t.content | FileCheck %s --check-prefix=CONTENT
# CONTENT: - Name: .relr.dyn
# CONTENT-NEXT: Type: SHT_RELR
# CONTENT-NEXT: Content: '11223344556677'
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2MSB
Type: ET_DYN
Sections:
- Name: .relr.dyn
Type: SHT_RELR
Content: "11223344556677"
## Test we are able to dump a SHT_RELR section when sh_entsize is invalid.
## Here we use 0xFE as a value instead of expected 0x8.
# RUN: yaml2obj --docnum=3 %s -o %t.entsize
# RUN: obj2yaml %t.entsize | FileCheck %s --check-prefix=ENTSIZE
# ENTSIZE: - Name: .relr.dyn
# ENTSIZE-NEXT: Type: SHT_RELR
# ENTSIZE-NEXT: EntSize: 0x00000000000000FE
# ENTSIZE-NEXT: Content: '1122334455667788'
# ENTSIZE-NEXT: ...
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2MSB
Type: ET_DYN
Sections:
- Name: .relr.dyn
Type: SHT_RELR
EntSize: 0xFE
Content: "1122334455667788"