87 lines · yaml
1## Test how we dump SHT_RELR sections for 32 and 64-bit targets.2 3## Test we use the "Entries" property when it is possible to4## dump values correctly. Also, check we do not dump sh_entsize when5## it has the default value.6 7# RUN: yaml2obj --docnum=1 -D BITS=32 -D ENCODE=LSB %s -o %t.32le8# RUN: obj2yaml %t.32le | FileCheck %s --check-prefix=ELF32LE9# RUN: yaml2obj --docnum=1 -D BITS=32 -D ENCODE=MSB %s -o %t.32be10# RUN: obj2yaml %t.32be | FileCheck %s --check-prefix=ELF32BE11# RUN: yaml2obj --docnum=1 -D BITS=64 -D ENCODE=LSB %s -o %t.64le12# RUN: obj2yaml %t.64le | FileCheck %s --check-prefix=ELF64LE13# RUN: yaml2obj --docnum=1 -D BITS=64 -D ENCODE=MSB %s -o %t.64be14# RUN: obj2yaml %t.64be | FileCheck %s --check-prefix=ELF64BE15 16# ELF64LE: Sections:17# ELF64LE-NEXT: - Name: .relr.dyn18# ELF64LE-NEXT: Type: SHT_RELR19# ELF64LE-NEXT: Entries: [ 0x8877665544332211 ]20 21# ELF32LE: Sections:22# ELF32LE-NEXT: - Name: .relr.dyn23# ELF32LE-NEXT: Type: SHT_RELR24# ELF32LE-NEXT: Entries: [ 0x44332211, 0x88776655 ]25 26# ELF64BE: Sections:27# ELF64BE-NEXT: - Name: .relr.dyn28# ELF64BE-NEXT: Type: SHT_RELR29# ELF64BE-NEXT: Entries: [ 0x1122334455667788 ]30 31# ELF32BE: Sections:32# ELF32BE-NEXT: - Name: .relr.dyn33# ELF32BE-NEXT: Type: SHT_RELR34# ELF32BE-NEXT: Entries: [ 0x11223344, 0x55667788 ]35 36--- !ELF37FileHeader:38 Class: ELFCLASS[[BITS]]39 Data: ELFDATA2[[ENCODE]]40 Type: ET_DYN41Sections:42 - Name: .relr.dyn43 Type: SHT_RELR44 Content: "1122334455667788"45 46## Test we use the "Content" property when a SHT_RELR section is truncated.47 48# RUN: yaml2obj --docnum=2 %s -o %t.content49# RUN: obj2yaml %t.content | FileCheck %s --check-prefix=CONTENT50 51# CONTENT: - Name: .relr.dyn52# CONTENT-NEXT: Type: SHT_RELR53# CONTENT-NEXT: Content: '11223344556677'54 55--- !ELF56FileHeader:57 Class: ELFCLASS6458 Data: ELFDATA2MSB59 Type: ET_DYN60Sections:61 - Name: .relr.dyn62 Type: SHT_RELR63 Content: "11223344556677"64 65## Test we are able to dump a SHT_RELR section when sh_entsize is invalid.66## Here we use 0xFE as a value instead of expected 0x8.67 68# RUN: yaml2obj --docnum=3 %s -o %t.entsize69# RUN: obj2yaml %t.entsize | FileCheck %s --check-prefix=ENTSIZE70 71# ENTSIZE: - Name: .relr.dyn72# ENTSIZE-NEXT: Type: SHT_RELR73# ENTSIZE-NEXT: EntSize: 0xFE74# ENTSIZE-NEXT: Content: '1122334455667788'75# ENTSIZE-NEXT: ...76 77--- !ELF78FileHeader:79 Class: ELFCLASS6480 Data: ELFDATA2MSB81 Type: ET_DYN82Sections:83 - Name: .relr.dyn84 Type: SHT_RELR85 EntSize: 0xFE86 Content: "1122334455667788"87