[PATCH] D80568: [llvm-objcopy][ELF] Fix removing a group member section.

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 07:34:28 PDT 2020


ikudrin marked an inline comment as done.
ikudrin added inline comments.


================
Comment at: llvm/tools/llvm-objcopy/ELF/Object.cpp:973
+Error GroupSection::removeSectionReferences(
+    bool AllowBrokenLinks, function_ref<bool(const SectionBase *)> ToRemove) {
+  llvm::erase_if(GroupMembers, ToRemove);
----------------
jhenderson wrote:
> ikudrin wrote:
> > jhenderson wrote:
> > > What happens if you remove the symbol table itself? I'm slightly concerned that it could leave the sh_link field invalid as presumably `Section::removeSectionReferences` won't be called for the GroupSection.
> > That is another issue with group sections, but not something which is introduced by this patch. Note that the base class for `GroupSection` is `SectionBase`, not `Section`. We need another patch for that.
> Thanks. I suspected something like that might have been the case. I guess it's something that needs fixing. Are you going to fix it shortly, or shall I file a bug?
Honestly, fixing that is a bit off my plans.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80568/new/

https://reviews.llvm.org/D80568





More information about the llvm-commits mailing list