brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 49f5980 Raw
42 lines · plain
1## This test shows that llvm-objcopy does not baulk at overlapping sections.2## These don't really make sense, but the tool should still handle invalid3## inputs somehow.4# RUN: yaml2obj %s -o %t.o5 6## Check that the contents are as expected before the copy.7# RUN: llvm-readobj -x .first -x .second %t.o | FileCheck %s --check-prefix=CONTENTS8 9## Now check that the section contents are still correct after the copy.10## Also characterize the behavior of llvm-objcopy in that it "unoverlaps" the11## two sections.12# RUN: llvm-objcopy %t.o %t2.o13# RUN: llvm-readobj --section-headers %t2.o | FileCheck %s14# RUN: llvm-readobj -x .first -x .second %t2.o | FileCheck %s --check-prefix=CONTENTS15 16# CHECK: Name: .first17# CHECK: Offset: 0x100018# CHECK: Name: .second19# CHECK: Offset: 0x100420 21# CONTENTS:      Hex dump of section '.first':22# CONTENTS-NEXT: 0x00000000 0123456723# CONTENTS-EMPTY:24# CONTENTS-NEXT: Hex dump of section '.second':25# CONTENTS-NEXT: 0x00000000 2345678926 27--- !ELF28FileHeader:29  Class:   ELFCLASS6430  Data:    ELFDATA2LSB31  Type:    ET_EXEC32  Machine: EM_X86_6433Sections:34  - Name: .first35    Type: SHT_PROGBITS36    Content: '01234567'37    AddressAlign: 0x100038  - Name: .second39    Type: SHT_PROGBITS40    Content: '89abcdef'41    ShOffset: 0x100142