[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:02:04 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:

I think it's probably sufficient to just have this case here - the same logic applies regardless of how the section is removed. I'd also switch to using `llvm-objcopy` to match the case earlier in the file.

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


More information about the llvm-commits mailing list