[PATCH] D59483: [llvm-objcopy]Preserve data in segments not covered by sections

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 19 11:55:18 PDT 2019


rupprecht added inline comments.


================
Comment at: test/tools/llvm-objcopy/ELF/preserve-segment-contents.test:26
+# RUN: %python -c "with open('%/t.in', 'r+') as input:          \
+# RUN:     input.seek(0x2000); input.write('\xDE\xAD\xBE\xEF'); \
+# RUN:     input.seek(0x2008); input.write('\xDE\xAD\xBE\xEF'); \
----------------
You could probably make this shorter just this in a loop, e.g.

```
with open('%/t.in', 'r+') as input:
  for offset in [
    0x2000, 0x2008, ...,
    ..., 0x5038]:
      input.seek(offset); input.write('\xDE\xAD\xBE\xEF');
```


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59483





More information about the llvm-commits mailing list