We should create CompressedSection only if the section has SHF_COMPRESSED flag
or it's name starts from '.zdebug'. Currently, we create it if data starts from ZLIB signature.
As a result, if you call isa<CompressedSection> on a section created, it would return false,
because classof checks the section name and not the ZLIB signature (what is correct):
https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/ELF/Object.h#L384
There is no test, as because of broken isa described such sections are handled as uncompressed:
https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/ELF/Object.cpp#L237
So patch does not change the behavior observed but allows to create the correct sections
from start.