summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objcopy/ELF/copy-after-strip-sections.test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/tools/llvm-objcopy/ELF/copy-after-strip-sections.test')
-rw-r--r--llvm/test/tools/llvm-objcopy/ELF/copy-after-strip-sections.test26
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objcopy/ELF/copy-after-strip-sections.test b/llvm/test/tools/llvm-objcopy/ELF/copy-after-strip-sections.test
new file mode 100644
index 00000000000..3b61649b263
--- /dev/null
+++ b/llvm/test/tools/llvm-objcopy/ELF/copy-after-strip-sections.test
@@ -0,0 +1,26 @@
+# llvm-objcopy's --strip-sections removes the section headers. It should be
+# possible to run the tool on the output after this operation. Performing any
+# subsequent stripping operation, or copying the object, should produce
+# identical output.
+
+# RUN: yaml2obj %s -o %t.in
+# RUN: llvm-objcopy %t.in %t.stripped --strip-sections
+# RUN: llvm-objcopy %t.stripped %t.stripped2 --strip-sections
+# RUN: llvm-objcopy %t.stripped2 %t.out
+# RUN: cmp %t.stripped %t.stripped2
+# RUN: cmp %t.stripped %t.out
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_EXEC
+ Machine: EM_X86_64
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Content: 'facefeed'
+ProgramHeaders:
+ - Type: PT_LOAD
+ Sections:
+ - Section: .text
OpenPOWER on IntegriCloud