summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objcopy/strict-no-add.test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/tools/llvm-objcopy/strict-no-add.test')
-rw-r--r--llvm/test/tools/llvm-objcopy/strict-no-add.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objcopy/strict-no-add.test b/llvm/test/tools/llvm-objcopy/strict-no-add.test
new file mode 100644
index 00000000000..b95182122bb
--- /dev/null
+++ b/llvm/test/tools/llvm-objcopy/strict-no-add.test
@@ -0,0 +1,10 @@
+# This test makes sure that sections added at the end that don't have symbols
+# defined in them don't trigger the creation of a large index table.
+
+RUN: unzip -p %p/Inputs/many-sections.o.zip > %t.0
+RUN: cat %p/Inputs/alloc-symtab.o > %t
+RUN: llvm-objcopy -R=.text -R=s0 -R=s1 -R=s2 -R=s3 -R=s4 -R=s5 -R=s6 %t.0 %t2
+RUN: llvm-objcopy -add-section=.s0=%t -add-section=.s1=%t -add-section=.s2=%t %t2 %t2
+RUN: llvm-readobj -sections %t2 | FileCheck --check-prefix=SECS %s
+
+SECS-NOT: Name: .symtab_shndx
OpenPOWER on IntegriCloud