[PATCH] D131290: [llvm-objdump] Create name for fake sections

Namhyung Kim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 10:10:17 PDT 2022


namhyung added inline comments.


================
Comment at: llvm/include/llvm/Object/ELF.h:778
 
-  for (auto Phdr : *PhdrsOrErr) {
-    if (!(Phdr.p_type & ELF::PT_LOAD) || !(Phdr.p_flags & ELF::PF_X))
+  FakeSectionStrings.append(StringRef("\0", 1));
+  for (auto [Idx, Phdr] : llvm::enumerate(*PhdrsOrErr)) {
----------------
jhenderson wrote:
> namhyung wrote:
> > jhenderson wrote:
> > > Do you actually need this?
> > Yep, Idx is a part of the section name.
> I wasn't referring to MaskRay's suggestion. I was referring to the line that's actually highlighted with this comment (i.e. line 778 in this diff).
Oh, I see.  Maybe it's not needed but I think it's a good practice to maintain offset 0 as an empty string.  Do you want me to remove it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131290



More information about the llvm-commits mailing list