llvm-deplibs-section.yaml
2.5 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
87
## Check how yaml2obj produces SHT_LLVM_DEPENDENT_LIBRARIES sections.
## Check we can describe SHT_LLVM_DEPENDENT_LIBRARIES using
## "Libraries" and "Content" properies.
# RUN: yaml2obj --docnum=1 %s -o %t1
# RUN: llvm-readobj --sections --section-data %t1 | FileCheck %s --check-prefix=LIBRARIES
# LIBRARIES: Name: .deplibs.lib
# LIBRARIES-NEXT: Type: SHT_LLVM_DEPENDENT_LIBRARIES (0x6FFF4C04)
# LIBRARIES-NEXT: Flags [ (0x0)
# LIBRARIES-NEXT: ]
# LIBRARIES-NEXT: Address: 0x0
# LIBRARIES-NEXT: Offset: 0x40
# LIBRARIES-NEXT: Size: 12
# LIBRARIES-NEXT: Link: 0
# LIBRARIES-NEXT: Info: 0
# LIBRARIES-NEXT: AddressAlignment: 0
# LIBRARIES-NEXT: EntrySize: 0
# LIBRARIES-NEXT: SectionData (
# LIBRARIES-NEXT: 0000: 666F6F00 62617200 666F6F00 |foo.bar.foo.|
# LIBRARIES-NEXT: )
# LIBRARIES: Name: .deplibs.content
# LIBRARIES-NEXT: Type: SHT_LLVM_DEPENDENT_LIBRARIES
# LIBRARIES-NEXT: Flags [
# LIBRARIES-NEXT: ]
# LIBRARIES-NEXT: Address: 0x0
# LIBRARIES-NEXT: Offset: 0x4C
# LIBRARIES-NEXT: Size: 3
# LIBRARIES-NEXT: Link: 0
# LIBRARIES-NEXT: Info: 0
# LIBRARIES-NEXT: AddressAlignment: 0
# LIBRARIES-NEXT: EntrySize: 0
# LIBRARIES-NEXT: SectionData (
# LIBRARIES-NEXT: 0000: 112233
# LIBRARIES-NEXT: )
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .deplibs.lib
Type: SHT_LLVM_DEPENDENT_LIBRARIES
Libraries: [ foo, bar, foo ]
- Name: .deplibs.content
Type: SHT_LLVM_DEPENDENT_LIBRARIES
Content: "112233"
## Check we report an error when "Libraries" and "Content" are used together.
# RUN: not yaml2obj --docnum=2 %s 2>&1 | FileCheck %s --check-prefix=LIBS-CONTENT
# LIBS-CONTENT: error: SHT_LLVM_DEPENDENT_LIBRARIES: "Libraries" and "Content" can't be used together
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .deplibs
Type: SHT_LLVM_DEPENDENT_LIBRARIES
Content: "FF"
Libraries: [ foo ]
## Check we create an empty section when neither "Libraries" nor "Content" are specified.
# RUN: yaml2obj --docnum=3 %s -o %t3
# RUN: llvm-readelf --sections %t3 | FileCheck %s --check-prefix=NOPROPS
# NOPROPS: [Nr] Name Type Address Off Size
# NOPROPS: [ 1] .deplibs LLVM_DEPENDENT_LIBRARIES 0000000000000000 000040 000000
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .deplibs
Type: SHT_LLVM_DEPENDENT_LIBRARIES