This patch moves core implementation of llvm-objcopy into ObjCopy library
(http://lists.llvm.org/pipermail/llvm-dev/2020-September/145075.html).
The functionality for parsing input options is left inside tools/llvm-objcopy.
The interface of ObjCopy library:
ObjCopy/ELF/ELFObjcopy.h
Error executeObjcopyOnIHex(const CopyConfig &Config, MemoryBuffer &In, Buffer &Out); Error executeObjcopyOnRawBinary(const CopyConfig &Config, MemoryBuffer &In, Buffer &Out); Error executeObjcopyOnBinary(const CopyConfig &Config, object::ELFObjectFileBase &In, Buffer &Out);
ObjCopy/COFF/COFFObjcopy.h
Error executeObjcopyOnBinary(const CopyConfig &Config, object::COFFObjectFile &In, Buffer &Out);
ObjCopy/MachO/MachOObjcopy.h
Error executeObjcopyOnBinary(const CopyConfig &Config, object::MachOObjectFile &In, Buffer &Out);
ObjCopy/wasm/WasmObjcopy.h
Error executeObjcopyOnBinary(const CopyConfig &Config, object::WasmObjectFile &In, Buffer &Out);
I've no issue with adding comments like these, but could you spin them off into separate patches, please, as they are independently useful, and this will help reduce the size of this patch.
Same applies for other new doc comments.