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 000380 000001
11 # CASE1-NEXT: [ 2] .symtab SYMTAB 0000000000000000 000398 000002
12 # CASE1-NEXT: [ 3] .dynamic DYNAMIC 0000000000000000 0003b0 000003
13 # CASE1-NEXT: [ 4] .rela RELA 0000000000000000 0003b0 000004
14 # CASE1-NEXT: [ 5] .nobits NOBITS 0000000000000000 0003b0 000005
15 # CASE1-NEXT: [ 6] .group GROUP 0000000000000000 0003b0 000006
16 # CASE1-NEXT: [ 7] .gnu.version VERSYM 0000000000000000 0003b0 000007
17 # CASE1-NEXT: [ 8] .gnu.version_r VERNEED 0000000000000000 0003b0 000008
18 # CASE1-NEXT: [ 9] .gnu.version_d VERDEF 0000000000000000 0003b0 000009
19 # CASE1-NEXT: [10] .regular PROGBITS 0000000000000000 0003b0 00000a
20 # CASE1-NEXT: [11] .strtab STRTAB 0000000000000000 0003b0 00000b
53 - Name: .gnu.version_r
55 Info: 0x0000000000000001
58 - Name: .gnu.version_d
60 Info: 0x0000000000000001
70 ## Here we check that defining ShSize does not actually change
71 ## the content and also does not affect file size.
73 # RUN: yaml2obj --docnum=2 %s -o %t2
74 # RUN: yaml2obj --docnum=3 %s -o %t3
75 # RUN: od -t x8 -v %t2 > %t.txt
76 # RUN: od -t x8 -v %t3 >> %t.txt
77 # RUN: FileCheck %s --input-file=%t.txt --check-prefix=CASE2
79 # CASE2: [[OFFSET:.*]] fefefefefefefefe
80 # CASE2: [[FILESIZE:.*]]{{$}}
81 # CASE2: [[OFFSET]] fefefefefefefefe
82 # CASE2: [[FILESIZE]]{{$}}
93 Content: "fefefefefefefefe"
105 Content: "fefefefefefefefe"
107 ## Check we can define sh_size larger than section content size
108 ## and thus create overlaping sections.
110 # RUN: yaml2obj --docnum=4 %s -o %t4
111 # RUN: llvm-readobj --sections --section-data %t4 | FileCheck %s --check-prefix=CASE4
114 # CASE4: SectionData (
115 # CASE4-NEXT: 0000: AAAABBBB |....|
117 # CASE4: SectionData (
118 # CASE4-NEXT: 0000: BBBB |..|
135 ## Check we can set both Size and ShSize and the number of the actual
136 ## bytes written is equal to Size in this case.
138 # RUN: yaml2obj --docnum=5 %s -o %t5
139 # RUN: od -t x1 -v %t5 | FileCheck %s --check-prefix=CASE5
141 # CASE5: aa aa 00 00 bb bb