[llvm] [llvm-strip] Remove empty SHT_GROUP sections. (PR #97141)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 4 02:20:15 PDT 2024


================
@@ -35,3 +35,35 @@ Symbols:
   - Name:     foo_bar_grp
     Section:  .group
     Binding:  STB_GLOBAL
+
+# RUN: yaml2obj --docnum=2 %s -o %t
+# RUN: llvm-strip --strip-debug %t -o %t1
+# RUN: llvm-readelf --section-groups %t1 | FileCheck %s --check-prefix=GROUP-REMOVED
+# RUN: llvm-strip --strip-unneeded %t -o %t2
+# RUN: llvm-readelf --section-groups %t2 | FileCheck %s --check-prefix=GROUP-REMOVED
+# RUN: llvm-strip --remove-section=.debug_macro %t -o %t3
----------------
jh7370 wrote:

We don't usually do that in llvm-objcopy testing. The behaviour of `--strip-debug` boils down to `--remove-section=.debug*`, roughly-speaking, so it would just be duplicate testing.

Putting it in other terms, say in 10 years time, somebody comes to look at this test when there are both `--strip-debug` and `--remove-section` cases, they may think there's something special about one or other when in fact the behaviour is generic. This would likely cause confusion and make it harder to understand the code and test purposes.

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


More information about the llvm-commits mailing list