[llvm] [llvm-objcopy] Report unsupported formats before compression (PR #202357)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 11 01:14:21 PDT 2026
https://github.com/jh7370 commented:
I actually think having the error early on may be a good idea: we don't really need one error per section for debug data in particular, because that's quite a few errors for a typical object file for no benefit.
The other aspect of it is that you probably want the error even if there are no such sections, to show you're trying to use an option that is invalid for your environment (so that it doesn't cause surprises when the input object changes, e.g. to have debug data). I'd go as far as to say that we should parse the --compress-sections option and report errors for unsupported formats early too (to match the timing of the --compress-debug-sections option).
The decompression case is different, because we don't know the necessary format until we've read the relevant section information, so checking and reporting it later makes sense, at which point we have the section names and we should report them.
https://github.com/llvm/llvm-project/pull/202357
More information about the llvm-commits
mailing list