[PATCH] D67610: [llvm-objcopy] - Remove python invocations from 2 test cases.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 02:55:42 PDT 2019


jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.

LGTM, with one possible suggestion.



================
Comment at: test/tools/llvm-objcopy/ELF/overlapping-sections-in-segments.test:7
 
-## 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.
+## Sanity check that section offsets overlap.
 # RUN: llvm-readobj --section-headers %t.o | FileCheck %s
----------------
I don't mind if you want to keep it, but you can probably just get rid of the sanity check now. Now it is just a check that yaml2obj works as expected.


================
Comment at: test/tools/llvm-objcopy/ELF/overlapping-sections.test:6
 
-## 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.
+## Sanity check that section offsets overlap.
 # RUN: llvm-readobj --section-headers %t.o | FileCheck %s --check-prefix=VALIDATE
----------------
Ditto.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67610/new/

https://reviews.llvm.org/D67610





More information about the llvm-commits mailing list