1 ## Check we are able to set custom sh_size field
2 ## for different sections.
4 # RUN: yaml2obj --docnum=1 %s -o %t1
5 # RUN: llvm-readelf --sections %t1 | FileCheck %s --check-prefix=CASE1
7 # CASE1: Section Headers:
8 # CASE1-NEXT: [Nr] Name Type Address Off Size
9 # CASE1-NEXT: [ 0] NULL 0000000000000000 000000 000000
10 # CASE1-NEXT: [ 1] .dynsym DYNSYM 0000000000000000 000040 000001
11 # CASE1-NEXT: [ 2] .symtab SYMTAB 0000000000000000 000058 000002
12 # CASE1-NEXT: [ 3] .dynamic DYNAMIC 0000000000000000 000070 000003
13 # CASE1-NEXT: [ 4] .rela RELA 0000000000000000 000070 000004
14 # CASE1-NEXT: [ 5] .nobits NOBITS 0000000000000000 000070 000005
15 # CASE1-NEXT: [ 6] .group GROUP 0000000000000000 000070 000006
16 # CASE1-NEXT: [ 7] .gnu.version VERSYM 0000000000000000 000070 000007
17 # CASE1-NEXT: [ 8] .gnu.version_r VERNEED 0000000000000000 000070 000008
18 # CASE1-NEXT: [ 9] .gnu.version_d VERDEF 0000000000000000 000070 000009
19 # CASE1-NEXT: [10] .regular PROGBITS 0000000000000000 000070 00000a
20 # CASE1-NEXT: [11] .strtab STRTAB 0000000000000000 000070 00000b
51 - Name: .gnu.version_r
55 - Name: .gnu.version_d
66 ## Here we check that defining ShSize does not actually change
67 ## the content and also does not affect file size.
69 # RUN: yaml2obj --docnum=2 %s -o %t2
70 # RUN: yaml2obj --docnum=3 %s -o %t3
71 # RUN: od -t x1 -v %t2 > %t.txt
72 # RUN: od -t x1 -v %t3 >> %t.txt
73 # RUN: FileCheck %s --input-file=%t.txt --ignore-case --check-prefix=CASE2
75 # CASE2: [[OFFSET:.*]] fe fe fe fe fe fe fe fe
76 # CASE2: [[FILESIZE:.*]]{{$}}
77 # CASE2: [[OFFSET]] fe fe fe fe fe fe fe fe
78 # CASE2: [[FILESIZE]]{{$}}
88 Content: "fefefefefefefefe"
99 Content: "fefefefefefefefe"
101 ## Check we can define sh_size larger than section content size
102 ## and thus create overlaping sections.
104 # RUN: yaml2obj --docnum=4 %s -o %t4
105 # RUN: llvm-readobj --sections --section-data %t4 | FileCheck %s --check-prefix=CASE4
108 # CASE4: SectionData (
109 # CASE4-NEXT: 0000: AAAABBBB |....|
111 # CASE4: SectionData (
112 # CASE4-NEXT: 0000: BBBB |..|
128 ## Check we can set both Size and ShSize and the number of the actual
129 ## bytes written is equal to Size in this case.
131 # RUN: yaml2obj --docnum=5 %s -o %t5
132 # RUN: od -t x1 -v %t5 | FileCheck %s --ignore-case --check-prefix=CASE5
134 # CASE5: aa aa 00 00 bb bb