[PATCH] D69526: [llvm-objcopy] Address post-commit reviews of D69093

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 08:59:28 PDT 2019


MaskRay added a comment.

In D69526#1724854 <https://reviews.llvm.org/D69526#1724854>, @jhenderson wrote:

> I think this part of one of my comments may have been missed, as I don't see a response to it anywhere:
>
> > Is there anything stopping the section header string table having the SHF_ALLOC bit set however? If not, we need a separate test for this case, I believe.
>
> I had another thought about this, and I wonder if we might mess things up if we try to change the section names when the section header string table has SHF_ALLOC set. But this seems unlikely, so is probably a non-issue.


I agree that changing section names may be delicate. Let's stick with:

  if (Sec.Type == ELF::SHT_STRTAB && !(Sec.Flags & SHF_ALLOC)) {
    StrTab = static_cast<StringTableSection *>(&Sec);
  
    // Prefer a string table that is not the section header string table, if
    // such a table exists.
    if (Obj.SectionNames != &Sec)
      break;
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69526





More information about the llvm-commits mailing list