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

Namhyung Kim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 23:50:58 PDT 2022


namhyung added inline comments.


================
Comment at: llvm/include/llvm/Object/ELF.h:656
+  if (!Index) {
+    // no section string table.
+    if (!FakeSectionStrings.empty())
----------------
jhenderson wrote:
> MaskRay wrote:
> > `// There is no section name string table. Return FakeSectionStrings which is non-empty if we have created fake sections.`
> @namhyung, I believe @MaskRay was suggesting using the comment he's posted instead of "no section string table", as an improvement. Please update.
Oh, I overlooked that, sorry.  Will update.


================
Comment at: llvm/test/Object/objdump-no-sectionheaders.test:2
+## This test checks llvm-objdump -h can handle ELF files without section info.
+## Only PT_LOAD program with PF_X flag will be display corresponding fake sections.
 
----------------
jhenderson wrote:
> 
ok


================
Comment at: llvm/test/Object/objdump-no-sectionheaders.test:22
+    NoHeaders:       true
+ProgramHeaders:
+  - Type:            PT_PHDR
----------------
jhenderson wrote:
> I think I see a potential problem here, which could explain the problem you're seeing: you haven't specified any contents or explicit offsets of any of these program headers, which may mean that even though they have addresses specified, they'll start at the same offset within the file. This might result in something bad such as only the one section appearing in the output, although I don't know the llvm-objdump code well enough to be certain.
Will check with contents and offsets.


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