Skip to content

Commit f079240

Browse files
committed
Distinguish ShOffset and Offset in program-header-size-offset.yaml, remove unneed test
Signed-off-by: Ruoyu Qiu <[email protected]>
1 parent 701efbe commit f079240

File tree

1 file changed

+5
-34
lines changed

1 file changed

+5
-34
lines changed

llvm/test/tools/yaml2obj/ELF/program-header-size-offset.yaml

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,25 @@ Sections:
4444
- Name: .text
4545
Type: SHT_PROGBITS
4646
Size: 4
47-
ShOffset: 0x1000
47+
Offset: 0x1000
4848
AddressAlign: 0x1000
4949
- Name: .rodata
5050
Type: SHT_PROGBITS
5151
Size: 4
52-
ShOffset: 0x2000
52+
Offset: 0x2000
5353
AddressAlign: 0x1000
5454
- Name: .data
5555
Type: SHT_PROGBITS
56-
ShOffset: 0x2004
56+
Offset: 0x2004
5757
Size: 4
5858
- Name: .nobits1
5959
Type: SHT_NOBITS
60-
ShOffset: 0x2008
60+
Offset: 0x2008
6161
Size: 1
6262
- Name: .nobits2
6363
Type: SHT_NOBITS
6464
# Intentionally set to 0x2009 though the previous section is SHT_NOBITS.
65-
ShOffset: 0x2009
65+
Offset: 0x2009
6666
Size: 1
6767
ProgramHeaders:
6868
# Program header with no sections.
@@ -179,32 +179,3 @@ ProgramHeaders:
179179
# RUN: FileCheck %s --check-prefix=INVALID-OFFSET
180180

181181
# INVALID-OFFSET: yaml2obj: error: 'Offset' for segment with index 1 must be less than or equal to the minimum file offset of all included sections (0x78)
182-
183-
## Document that the "Offset" value is checked after the section offset is overriden using "ShOffset".
184-
# RUN: yaml2obj --docnum=4 %s -o %t5
185-
# RUN: llvm-readelf %t5 --sections --program-headers | FileCheck %s --check-prefix=SHOFFSET
186-
187-
# SHOFFSET: [Nr] Name Type Address Off
188-
# SHOFFSET: [ 1] .foo PROGBITS 0000000000000000 ffffffff
189-
190-
# SHOFFSET: Type Offset
191-
# SHOFFSET-NEXT: LOAD 0xffffff00
192-
193-
--- !ELF
194-
FileHeader:
195-
Class: ELFCLASS64
196-
Data: ELFDATA2LSB
197-
Type: ET_EXEC
198-
Sections:
199-
- Name: .foo
200-
Type: SHT_PROGBITS
201-
Flags: [ SHF_ALLOC ]
202-
Size: 0x1
203-
## Note: the real .foo offset is much less than 0xFFFFFFFF or
204-
## 0xFFFFFF00, but no error is reported.
205-
ShOffset: 0xFFFFFFFF
206-
ProgramHeaders:
207-
- Type: PT_LOAD
208-
Offset: 0xFFFFFF00
209-
FirstSec: .foo
210-
LastSec: .foo

0 commit comments

Comments
 (0)