brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 15a2dc3 Raw
65 lines · plain
1# RUN: yaml2obj %s -o %t2# RUN: llvm-objcopy -O binary -j .test2 %t %t.sec3# RUN: llvm-objcopy -R .test2 %t %t24# RUN: llvm-objcopy --add-section=.test2=%t.sec %t2 %t35# RUN: llvm-readobj --file-headers --sections --section-data %t3 | FileCheck %s6 7!ELF8FileHeader:9  Class:           ELFCLASS6410  Data:            ELFDATA2LSB11  Type:            ET_REL12  Machine:         EM_X86_6413Sections:14  - Name:            .test115    Type:            SHT_PROGBITS16    Flags:           [ SHF_ALLOC ]17    Content:        "c3c3c3c3"18  - Name:            .test219    Type:            SHT_PROGBITS20    Flags:           [ SHF_ALLOC ]21    Content:        "DEADBEEF"22  - Name:            .test323    Type:            SHT_PROGBITS24    Flags:           [ SHF_ALLOC ]25    Content:        "32323232"26 27# CHECK: SectionHeaderCount: 628 29# CHECK:      Name: .test130# CHECK:      Name: .test331# CHECK:      Name: .strtab32# CHECK:      Name: .shstrtab33# CHECK:      Offset: 0x[[#%x,OFFSET:]]34# CHECK:      Size: [[#%u,SIZE:]]35# CHECK:      Name: .test236# CHECK-NEXT: Type: SHT_PROGBITS37# CHECK-NEXT: Flags [ (0x0)38# CHECK-NEXT: ]39# CHECK-NEXT: Address: 0x040# CHECK-NEXT: Offset: 0x[[#%x,OFFSET+SIZE]]41# CHECK-NEXT: Size: 442# CHECK-NEXT: Link: 043# CHECK-NEXT: Info: 044# CHECK-NEXT: AddressAlignment: 145# CHECK-NEXT: EntrySize: 046# CHECK-NEXT: SectionData (47# CHECK-NEXT:   0000: DEADBEEF48# CHECK-NEXT: )49 50## Test that llvm-objcopy produces an error if the file with section contents51## to be added does not exist.52# RUN: not llvm-objcopy --add-section=.section.name=%t.missing %t %t.out 2>&1 | FileCheck -DFILE=%t.missing -DMSG=%errc_ENOENT %s --check-prefixes=ERR153 54# ERR1: error: '[[FILE]]': [[MSG]]55 56## Negative test for invalid --add-sections argument - missing '='.57# RUN: not llvm-objcopy --add-section=.section.name %t %t.out 2>&1 | FileCheck %s --check-prefixes=ERR258 59# ERR2: error: bad format for --add-section: missing '='60 61## Negative test for invalid --add-sections argument - missing file name.62# RUN: not llvm-objcopy --add-section=.section.name= %t %t.out 2>&1 | FileCheck %s --check-prefixes=ERR363 64# ERR3: error: bad format for --add-section: missing file name65