1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/test/Object/yaml2obj-elf-section-invalid-size.yaml
George Rimar e2b65f9692 [yaml2obj/obj2yaml] - Make RawContentSection::Content and RawContentSection::Size optional
This is a follow-up for D62809.

Content and Size fields should be optional as was discussed in comments
of the D62809's thread. With that, we can describe a specific string table and
symbol table sections in a more correct way and also show appropriate errors.

The patch adds lots of test cases where the behavior is described in details.

Differential revision: https://reviews.llvm.org/D62957

llvm-svn: 362931
2019-06-10 12:43:18 +00:00

27 lines
566 B
YAML

# RUN: not yaml2obj -o %t %s 2>&1 | FileCheck %s
!ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Content: EBFE
AddressAlign: 2
- Name: .data
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC ]
Content: 0000000000000000
Size: 2
# CHECK: YAML:17:5: error: Section size must be greater than or equal to the content size
# CHECK-NEXT: - Name: .data
# CHECK-NEXT: ^
# CHECK-NEXT: yaml2obj: Failed to parse YAML file!