[llvm] [llvm-objcopy] Add --compress-sections (PR #85036)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 02:37:32 PDT 2024


================
@@ -0,0 +1,32 @@
+## Disallow (de)compression for sections within a segment as they are
+## effectively immutable.
+# RUN: rm -rf %t && mkdir %t && cd %t
+# RUN: yaml2obj %s -o a
+# RUN: not llvm-objcopy a /dev/null --compress-sections .text=zlib --compress-sections foo=none 2>&1 | FileCheck %s
+
+# CHECK: error: 'a': section '.text' within a segment cannot be (de)compressed
----------------
jh7370 wrote:

So this test only checks that we report an error for the .text section. It doesn't actually cover the decompression case at all, since the code bails out with the first error. Perhaps this test needs splitting into two separate runs, one for each section?

https://github.com/llvm/llvm-project/pull/85036


More information about the llvm-commits mailing list