1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/tools/obj2yaml/ELF/relr-section.yaml
Georgii Rymar 53a457743b Reland "[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16/Hex32 types." (https://reviews.llvm.org/D90930).
This reverts reverting commit fc40a03323a4b265ccbed34a07e281b13c5e8367
and fixes LLD (MachO/wasm) tests that failed previously.
2020-11-18 13:08:46 +03:00

87 lines
2.6 KiB
YAML

## Test how we dump SHT_RELR sections for 32 and 64-bit targets.
## Test we use the "Entries" property when it is possible to
## dump values correctly. Also, check we do not dump sh_entsize when
## it has the default value.
# RUN: yaml2obj --docnum=1 -D BITS=32 -D ENCODE=LSB %s -o %t.32le
# RUN: obj2yaml %t.32le | FileCheck %s --check-prefix=ELF32LE
# RUN: yaml2obj --docnum=1 -D BITS=32 -D ENCODE=MSB %s -o %t.32be
# RUN: obj2yaml %t.32be | FileCheck %s --check-prefix=ELF32BE
# RUN: yaml2obj --docnum=1 -D BITS=64 -D ENCODE=LSB %s -o %t.64le
# RUN: obj2yaml %t.64le | FileCheck %s --check-prefix=ELF64LE
# RUN: yaml2obj --docnum=1 -D BITS=64 -D ENCODE=MSB %s -o %t.64be
# RUN: obj2yaml %t.64be | FileCheck %s --check-prefix=ELF64BE
# ELF64LE: Sections:
# ELF64LE-NEXT: - Name: .relr.dyn
# ELF64LE-NEXT: Type: SHT_RELR
# ELF64LE-NEXT: Entries: [ 0x8877665544332211 ]
# ELF32LE: Sections:
# ELF32LE-NEXT: - Name: .relr.dyn
# ELF32LE-NEXT: Type: SHT_RELR
# ELF32LE-NEXT: Entries: [ 0x44332211, 0x88776655 ]
# ELF64BE: Sections:
# ELF64BE-NEXT: - Name: .relr.dyn
# ELF64BE-NEXT: Type: SHT_RELR
# ELF64BE-NEXT: Entries: [ 0x1122334455667788 ]
# ELF32BE: Sections:
# ELF32BE-NEXT: - Name: .relr.dyn
# ELF32BE-NEXT: Type: SHT_RELR
# ELF32BE-NEXT: Entries: [ 0x11223344, 0x55667788 ]
--- !ELF
FileHeader:
Class: ELFCLASS[[BITS]]
Data: ELFDATA2[[ENCODE]]
Type: ET_DYN
Sections:
- Name: .relr.dyn
Type: SHT_RELR
Content: "1122334455667788"
## Test we use the "Content" property when a SHT_RELR section is truncated.
# RUN: yaml2obj --docnum=2 %s -o %t.content
# RUN: obj2yaml %t.content | FileCheck %s --check-prefix=CONTENT
# CONTENT: - Name: .relr.dyn
# CONTENT-NEXT: Type: SHT_RELR
# CONTENT-NEXT: Content: '11223344556677'
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2MSB
Type: ET_DYN
Sections:
- Name: .relr.dyn
Type: SHT_RELR
Content: "11223344556677"
## Test we are able to dump a SHT_RELR section when sh_entsize is invalid.
## Here we use 0xFE as a value instead of expected 0x8.
# RUN: yaml2obj --docnum=3 %s -o %t.entsize
# RUN: obj2yaml %t.entsize | FileCheck %s --check-prefix=ENTSIZE
# ENTSIZE: - Name: .relr.dyn
# ENTSIZE-NEXT: Type: SHT_RELR
# ENTSIZE-NEXT: EntSize: 0xFE
# ENTSIZE-NEXT: Content: '1122334455667788'
# ENTSIZE-NEXT: ...
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2MSB
Type: ET_DYN
Sections:
- Name: .relr.dyn
Type: SHT_RELR
EntSize: 0xFE
Content: "1122334455667788"