[llvm-objcopy] Support --{,de}compress-debug-sections for zstd
authorFangrui Song <i@maskray.me>
Thu, 8 Sep 2022 07:59:14 +0000 (00:59 -0700)
committerFangrui Song <i@maskray.me>
Thu, 8 Sep 2022 07:59:14 +0000 (00:59 -0700)
commitb6e1fd761d2831fef82c7ce4909832a10cce5dc2
treeac9e3a90b79610d0f11126fc8bb73e7fc3771e37
parenta41977dd0f4fd7aaad5ec380d50782296a690b47
[llvm-objcopy] Support --{,de}compress-debug-sections for zstd

Also, add ELFCOMPRESS_ZSTD (2) from the approved generic-abi proposal:
https://groups.google.com/g/generic-abi/c/satyPkuMisk
("Add new ch_type value: ELFCOMPRESS_ZSTD")

Link: https://discourse.llvm.org/t/rfc-zstandard-as-a-second-compression-method-to-llvm/63399
("[RFC] Zstandard as a second compression method to LLVM")

Reviewed By: jhenderson, dblaikie

Differential Revision: https://reviews.llvm.org/D130458
12 files changed:
llvm/docs/CommandGuide/llvm-objcopy.rst
llvm/include/llvm/BinaryFormat/ELF.h
llvm/lib/ObjCopy/ELF/ELFObject.cpp
llvm/lib/ObjCopy/ELF/ELFObject.h
llvm/test/tools/llvm-objcopy/ELF/compress-debug-sections-default.test
llvm/test/tools/llvm-objcopy/ELF/compress-debug-sections-zlib.test
llvm/test/tools/llvm-objcopy/ELF/compress-debug-sections-zstd-err.test [new file with mode: 0644]
llvm/test/tools/llvm-objcopy/ELF/compress-debug-sections-zstd.test [new file with mode: 0644]
llvm/test/tools/llvm-objcopy/ELF/decompress-debug-sections-err.test [new file with mode: 0644]
llvm/tools/llvm-objcopy/ObjcopyOptions.cpp
llvm/tools/llvm-objcopy/ObjcopyOpts.td
llvm/utils/lit/lit/llvm/config.py