summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objcopy/add-section.test
diff options
context:
space:
mode:
authorJake Ehrlich <jakehehrlich@google.com>2017-12-19 00:47:30 +0000
committerJake Ehrlich <jakehehrlich@google.com>2017-12-19 00:47:30 +0000
commite8437de727ed208cc4a8b7b36b6165dca89fafcb (patch)
tree49925acbe0c18e22f600ec664772aa06bc11615f /llvm/test/tools/llvm-objcopy/add-section.test
parente29c0b88628c0f353d2fa1423525fe4acbd7ad67 (diff)
downloadbcm5719-llvm-e8437de727ed208cc4a8b7b36b6165dca89fafcb.tar.gz
bcm5719-llvm-e8437de727ed208cc4a8b7b36b6165dca89fafcb.zip
[llvm-objcopy] Add option to add a progbits section from a file
This change adds support for adding progbits sections with contents from a file Differential Revision: https://reviews.llvm.org/D41212 llvm-svn: 321047
Diffstat (limited to 'llvm/test/tools/llvm-objcopy/add-section.test')
-rw-r--r--llvm/test/tools/llvm-objcopy/add-section.test37
1 files changed, 37 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-objcopy/add-section.test b/llvm/test/tools/llvm-objcopy/add-section.test
new file mode 100644
index 00000000000..048edcba227
--- /dev/null
+++ b/llvm/test/tools/llvm-objcopy/add-section.test
@@ -0,0 +1,37 @@
+# RUN: yaml2obj %s > %t
+# RUN: llvm-objcopy -O binary -j .test2 %t %t.sec
+# RUN: llvm-objcopy -R=.test2 %t %t2
+# RUN: llvm-objcopy -add-section=.test2=%t.sec %t2 %t3
+# RUN: llvm-readobj -file-headers -sections -section-data %t3 | FileCheck %s
+
+!ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+Sections:
+ - Name: .test1
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC ]
+ Content: "c3c3c3c3"
+ - Name: .test2
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC ]
+ Content: "DEADBEEF"
+ - Name: .test3
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC ]
+ Content: "32323232"
+
+# CHECK: SectionHeaderCount: 7
+
+# CHECK: Name: .test1
+# CHECK: Name: .test3
+# CHECK: Name: .symtab
+# CHECK: Name: .strtab
+# CHECK: Name: .shstrtab
+# CHECK: Name: .test2
+# CHECK: SectionData (
+# CHECK-NEXT: 0000: DEADBEEF
+# CHECK-NEXT: )
OpenPOWER on IntegriCloud