diff options
| author | George Rimar <grimar@accesssoftek.com> | 2019-09-17 08:38:53 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2019-09-17 08:38:53 +0000 |
| commit | a5dfa70806be78c5e07f14b14c758a4223935024 (patch) | |
| tree | 8f0d6a06f5e64a7c34a1411716432151800f46d1 /llvm/test/tools/llvm-objcopy/ELF | |
| parent | 42fe2fc8c9359f300413cbd0f105ff0eb9559d6f (diff) | |
| download | bcm5719-llvm-a5dfa70806be78c5e07f14b14c758a4223935024.tar.gz bcm5719-llvm-a5dfa70806be78c5e07f14b14c758a4223935024.zip | |
[llvm-objcopy] - Remove python invocations from 2 test cases.
It is possible to use yaml2obj to create sections with overlapping sh_offset now.
This patch does that.
Differential revision: https://reviews.llvm.org/D67610
llvm-svn: 372081
Diffstat (limited to 'llvm/test/tools/llvm-objcopy/ELF')
| -rw-r--r-- | llvm/test/tools/llvm-objcopy/ELF/overlapping-sections-in-segments.test | 12 | ||||
| -rw-r--r-- | llvm/test/tools/llvm-objcopy/ELF/overlapping-sections.test | 17 |
2 files changed, 2 insertions, 27 deletions
diff --git a/llvm/test/tools/llvm-objcopy/ELF/overlapping-sections-in-segments.test b/llvm/test/tools/llvm-objcopy/ELF/overlapping-sections-in-segments.test index cd92a7eb643..1c7cb2814fe 100644 --- a/llvm/test/tools/llvm-objcopy/ELF/overlapping-sections-in-segments.test +++ b/llvm/test/tools/llvm-objcopy/ELF/overlapping-sections-in-segments.test @@ -4,17 +4,6 @@ ## inputs somehow. # RUN: yaml2obj %s -o %t.o -## First, check the address of the section header table. -# RUN: llvm-readobj --file-headers %t.o | FileCheck %s --check-prefix=SHDRS-OFFSET -# SHDRS-OFFSET: SectionHeaderOffset: 0x1050{{$}} - -## Binary edit the section header sh_offset field of the second section to -## (e_shoff+64*2+24 = 0x10e8) overlap the first one. -# RUN: %python -c "with open('%/t.o', 'r+b') as input: import struct; bytes = struct.pack('<Q', 0x1001); input.seek(0x10e8); input.write(bytes)" - -## Sanity check that the binary editing modified the correct field. -# RUN: llvm-readobj --section-headers %t.o | FileCheck %s - ## Check that the contents are as expected before the copy. # RUN: llvm-readobj -x .first -x .second %t.o | FileCheck %s --check-prefix=CONTENTS @@ -49,6 +38,7 @@ Sections: - Name: .second Type: SHT_PROGBITS Content: '89abcdef' + ShOffset: 0x1001 ProgramHeaders: - Type: PT_LOAD FileSize: 5 diff --git a/llvm/test/tools/llvm-objcopy/ELF/overlapping-sections.test b/llvm/test/tools/llvm-objcopy/ELF/overlapping-sections.test index 2c470e6adc1..49f59804e9d 100644 --- a/llvm/test/tools/llvm-objcopy/ELF/overlapping-sections.test +++ b/llvm/test/tools/llvm-objcopy/ELF/overlapping-sections.test @@ -3,22 +3,6 @@ ## inputs somehow. # RUN: yaml2obj %s -o %t.o -## First, check the address of the section header table. -# RUN: llvm-readobj --file-headers %t.o | FileCheck %s --check-prefix=SHDRS-OFFSET -# SHDRS-OFFSET: SectionHeaderOffset: 0x1050{{$}} - -## Binary edit the section header sh_offset field of the second section to -## (e_shoff+64*2+24 = 0x10e8) overlap the first one. -# RUN: %python -c "with open('%/t.o', 'r+b') as input: import struct; bytes = struct.pack('<Q', 0x1001); input.seek(0x10e8); input.write(bytes)" - -## Sanity check that the binary editing modified the correct field. -# RUN: llvm-readobj --section-headers %t.o | FileCheck %s --check-prefix=VALIDATE - -# VALIDATE: Name: .first -# VALIDATE: Offset: 0x1000 -# VALIDATE: Name: .second -# VALIDATE: Offset: 0x1001 - ## Check that the contents are as expected before the copy. # RUN: llvm-readobj -x .first -x .second %t.o | FileCheck %s --check-prefix=CONTENTS @@ -54,3 +38,4 @@ Sections: - Name: .second Type: SHT_PROGBITS Content: '89abcdef' + ShOffset: 0x1001 |

