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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 00:58:07 PDT 2022


jhenderson added inline comments.


================
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 display corresponding fake sections.
 
----------------
I misread this sentence. Here's a better improvement.


================
Comment at: llvm/test/Object/objdump-no-sectionheaders.test:22
+    NoHeaders:       true
+ProgramHeaders:
+  - Type:            PT_PHDR
----------------
namhyung wrote:
> 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.
The `Offset` will physically impact the size of the file on disk, meaning this generated YAML file will be huge. Instead, use offset values around 0x100 - 0x200, which are significantly smaller (and adjust the addresses to line up too, I recommend) (you can't use 0 because of the ELF header and Program Header table). Also, the sizes of the individual blobs of data can be only a couple of bytes for the test purposes to be satisfied.


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