Skip to content

Commit a5dfa70

Browse files
author
George Rimar
committed
[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
1 parent 42fe2fc commit a5dfa70

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

llvm/test/tools/llvm-objcopy/ELF/overlapping-sections-in-segments.test

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@
44
## inputs somehow.
55
# RUN: yaml2obj %s -o %t.o
66

7-
## First, check the address of the section header table.
8-
# RUN: llvm-readobj --file-headers %t.o | FileCheck %s --check-prefix=SHDRS-OFFSET
9-
# SHDRS-OFFSET: SectionHeaderOffset: 0x1050{{$}}
10-
11-
## Binary edit the section header sh_offset field of the second section to
12-
## (e_shoff+64*2+24 = 0x10e8) overlap the first one.
13-
# RUN: %python -c "with open('%/t.o', 'r+b') as input: import struct; bytes = struct.pack('<Q', 0x1001); input.seek(0x10e8); input.write(bytes)"
14-
15-
## Sanity check that the binary editing modified the correct field.
16-
# RUN: llvm-readobj --section-headers %t.o | FileCheck %s
17-
187
## Check that the contents are as expected before the copy.
198
# RUN: llvm-readobj -x .first -x .second %t.o | FileCheck %s --check-prefix=CONTENTS
209

@@ -49,6 +38,7 @@ Sections:
4938
- Name: .second
5039
Type: SHT_PROGBITS
5140
Content: '89abcdef'
41+
ShOffset: 0x1001
5242
ProgramHeaders:
5343
- Type: PT_LOAD
5444
FileSize: 5

llvm/test/tools/llvm-objcopy/ELF/overlapping-sections.test

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,6 @@
33
## inputs somehow.
44
# RUN: yaml2obj %s -o %t.o
55

6-
## First, check the address of the section header table.
7-
# RUN: llvm-readobj --file-headers %t.o | FileCheck %s --check-prefix=SHDRS-OFFSET
8-
# SHDRS-OFFSET: SectionHeaderOffset: 0x1050{{$}}
9-
10-
## Binary edit the section header sh_offset field of the second section to
11-
## (e_shoff+64*2+24 = 0x10e8) overlap the first one.
12-
# RUN: %python -c "with open('%/t.o', 'r+b') as input: import struct; bytes = struct.pack('<Q', 0x1001); input.seek(0x10e8); input.write(bytes)"
13-
14-
## Sanity check that the binary editing modified the correct field.
15-
# RUN: llvm-readobj --section-headers %t.o | FileCheck %s --check-prefix=VALIDATE
16-
17-
# VALIDATE: Name: .first
18-
# VALIDATE: Offset: 0x1000
19-
# VALIDATE: Name: .second
20-
# VALIDATE: Offset: 0x1001
21-
226
## Check that the contents are as expected before the copy.
237
# RUN: llvm-readobj -x .first -x .second %t.o | FileCheck %s --check-prefix=CONTENTS
248

@@ -54,3 +38,4 @@ Sections:
5438
- Name: .second
5539
Type: SHT_PROGBITS
5640
Content: '89abcdef'
41+
ShOffset: 0x1001

0 commit comments

Comments
 (0)