summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objcopy/strip-non-alloc.test
diff options
context:
space:
mode:
authorJake Ehrlich <jakehehrlich@google.com>2017-11-14 18:50:24 +0000
committerJake Ehrlich <jakehehrlich@google.com>2017-11-14 18:50:24 +0000
commitd56725a042871238ed0a4ad4576497b55db2c960 (patch)
treee9407a7a2db7a08e86cbd25d3f2c5c992ffe95ab /llvm/test/tools/llvm-objcopy/strip-non-alloc.test
parent0b2f73fd84ca59735efdec4b230941634b59e485 (diff)
downloadbcm5719-llvm-d56725a042871238ed0a4ad4576497b55db2c960.tar.gz
bcm5719-llvm-d56725a042871238ed0a4ad4576497b55db2c960.zip
[llvm-objcopy] Add -strip-non-alloc option to remove all non-allocated sections
This change adds a new flag not present in GNU objcopy that we call --strip-non-alloc. Differential Revision: https://reviews.llvm.org/D39926 llvm-svn: 318168
Diffstat (limited to 'llvm/test/tools/llvm-objcopy/strip-non-alloc.test')
-rw-r--r--llvm/test/tools/llvm-objcopy/strip-non-alloc.test26
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objcopy/strip-non-alloc.test b/llvm/test/tools/llvm-objcopy/strip-non-alloc.test
new file mode 100644
index 00000000000..270670cffd3
--- /dev/null
+++ b/llvm/test/tools/llvm-objcopy/strip-non-alloc.test
@@ -0,0 +1,26 @@
+# RUN: yaml2obj %s > %t
+# RUN: llvm-objcopy --strip-non-alloc %t %t2
+# RUN: llvm-readobj -file-headers -sections %t2 | FileCheck %s
+
+!ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+Sections:
+ - Name: .bss
+ Type: SHT_NOBITS
+ Flags: [ SHF_ALLOC ]
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ - Name: .blarg
+ Type: SHT_PROGBITS
+ Flags: [ ]
+
+# CHECK: SectionHeaderCount: 4
+
+# CHECK: Name: .bss
+# CHECK: Name: .text
+# CHECK: Name: .shstrtab
OpenPOWER on IntegriCloud