1 # Show that --remove-section removes sections in segments.
3 # RUN: yaml2obj %s -o %t
5 # Validate the offsets for the later parts of the test.
6 # RUN: llvm-objcopy %t %t.copy
7 # Skip to the start of the sections, which should be immediately after the
8 # program header table (i.e. sizeof(Elf64_Ehdr) + sizeof(Elf64_Phdr) == 120).
9 # RUN: od -t x1 -N 16 -j 120 %t.copy | FileCheck %s --check-prefix=COPY
11 # COPY: 11 22 33 44 55 66 77 88
13 # RUN: llvm-objcopy --remove-section non_alloc %t %t.nonalloc
14 # RUN: llvm-readelf --sections %t.nonalloc | FileCheck %s --check-prefix=NONALLOC-SHDRS
15 # RUN: od -t x1 -N 16 -j 120 %t.nonalloc | FileCheck %s --check-prefix=NONALLOC-BYTES
17 # NONALLOC-SHDRS-NOT: non_alloc
18 # NONALLOC-BYTES: 11 22 33 44 00 00 00 00
20 # RUN: llvm-objcopy --remove-section shf_alloc %t %t.alloc
21 # RUN: llvm-readelf --sections %t.alloc | FileCheck %s --check-prefix=ALLOC-SHDRS
22 # RUN: od -t x1 -N 16 -j 120 %t.alloc | FileCheck %s --check-prefix=ALLOC-BYTES
24 # ALLOC-SHDRS-NOT: shf_alloc
25 # ALLOC-BYTES: 00 00 00 00 55 66 77 88
43 # Use an arbitrary segment type to show that the segment type is unimportant.