[PATCH] D65541: [llvm-objcopy][MachO] Implement --only-section

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 01:42:21 PDT 2019


alexshap added inline comments.


================
Comment at: llvm/test/tools/llvm-objcopy/MachO/only-section.test:2
+RUN: yaml2obj %p/Inputs/only-section.yaml > %t
+RUN: llvm-objcopy --only-section __TEXT,__text --only-section __TEXT,__eh_frame %t %t2
+RUN: llvm-readobj --sections %t2 | FileCheck %s
----------------
0. I think we need to make this test more robust and verify that the content of those sections is correct as well as the load commands, etc 
we also need tests:
1. where the specified arguments are invalid (to test error messages)
2. what happens when the specified section name is not present in the input binary
3. where all the sections should stay in place (i.e. --only-section lists all the available sections) -> the  output binary should be "the same" (unless there is some ambiguity, i.e. the values of the padding bytes might be different, but I'd add a small test (as small as possible))  


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65541





More information about the llvm-commits mailing list