[llvm] [llvm-strip] Remove empty SHT_GROUP sections. (PR #97204)
Thorsten Schütt via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 30 08:16:23 PDT 2024
================
@@ -2206,8 +2206,16 @@ Error Object::removeSections(
// Transfer removed sections into the Object RemovedSections container for use
// later.
std::move(Iter, Sections.end(), std::back_inserter(RemovedSections));
- // Now finally get rid of them all together.
+ // Now get rid of them all together.
Sections.erase(Iter, std::end(Sections));
+
+ // Finally iterate over all sections and erase empty SHT_GROUP sections.
+ for (auto Iter = Sections.begin(); Iter != Sections.end(); ++Iter) {
----------------
tschuett wrote:
Or:
```
llvm::remove_if(Sections, Lambda_Predicate);
```
https://github.com/llvm/llvm-project/pull/97204
More information about the llvm-commits
mailing list