[PATCH] D77805: [obj2yaml] - Teach obj2yaml to dump SHT_NOBITS sections when dumping program headers.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 02:14:22 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/obj2yaml/program-headers.yaml:548
+      - Section: .data.2
+## Case 5: another two SHT_NOBITS sections in the different segment.
+  - Type:  PT_LOAD
----------------
in a different


================
Comment at: llvm/test/tools/obj2yaml/program-headers.yaml:559
+    Flags:   [ SHF_WRITE, SHF_ALLOC ]
+    Address: 0x1000
+    Size:    0x1
----------------
Could you add some comments to these sections saying why the Address and Size values were chosen. It's not particularly clear to me how they're important to the test.


================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:314
+
+  // The SHT_NOBITS section occupy no physical space in a file. Such section
+  // belongs to the segment when it resides in segment's virtual address
----------------
"SHT_NOBITS sections usually occupy no physical space in a file. Such sections belong to a segment when they reside in the segment's virtual address space."

I added the "usually" because I think a SHT_NOBITS section sandwiched between two non NOBITS sections might need to be allocated file space to avoid things pointing to the wrong place.


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

https://reviews.llvm.org/D77805





More information about the llvm-commits mailing list