[PATCH] D90796: [llvm-objcopy][MachO] Skip sections with zero offset

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 10:17:02 PST 2020


alexshap added inline comments.


================
Comment at: llvm/test/tools/llvm-objcopy/MachO/zero-offset-section.test:1
+## This test verifies that a regular (non-zero-fill) section with zero offset 
+## is not modifed, this behavior is consistent with cctools' strip.
----------------
alexshap wrote:
> smeenai wrote:
> > Zero offset *and* zero size, right?
> yeah
unfortunately I'm not sure I can post the binaries (and not sure how exactly they were created).

P.S. Initially I was considering skipping sections with zero size, but after some search I've found mentions of binaries with zero-size sections and non-zero offsets (in fact, even in our existing tests we have such examples, but I've noticed them e.g. here: https://gitlab.haskell.org/TDecki/ghc/commit/0d31ccdd5754b10fb27fcdc95ddd6c937ecec1bd). Therefore, the approach in this diff (where we look at the original file offset) seems to be safer (it works fine for both cases).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90796



More information about the llvm-commits mailing list