[PATCH] D101560: [llvm-objcopy][ELF] --only-keep-debug: set offset/size of segments with no sections to zero

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 30 01:04:39 PDT 2021


jhenderson added a comment.

This change makes some sense to me in itself (IIRC GNU objcopy sets segment offsets to 0 for empty segments even without `--only-keep-debug`), but I don't think the test quite covers the same case as @rupprecht's bug report? In that report, the sections have been stripped. Maybe it doesn't matter, but maybe we need a separate test case for `--strip-sections` followed separately by `--only-keep-debug`?



================
Comment at: llvm/test/tools/llvm-objcopy/ELF/only-keep-debug.test:284
+
+
+## The offset and size fields of segments which contain no section and have no
----------------
Any particular reason for the double blank line?


================
Comment at: llvm/tools/llvm-objcopy/ELF/Object.cpp:2323
+    //
+    // For an empty segment contains no section (see sectionWithinSegment). If
+    // it has a parent segment, copy the parent segment's offset field. This
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101560



More information about the llvm-commits mailing list