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

Seiya Nuta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 2 00:34:23 PDT 2019


seiya marked an inline comment as done.
seiya 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
----------------
alexshap wrote:
> 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))  
> 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 

AFAIK, yaml2macho.cpp fills sections with dummy data (0xDEADBEEFu) so I'll write another patch to allow specifying arbitrary binary data in a MachO YAML.


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