[PATCH] D74955: [obj2yaml] - Dump allocatable SHT_STRTAB, SHT_SYMTAB and SHT_DYNSYM sections.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 28 02:08:52 PST 2020


jhenderson added a comment.

A thought, but I think it's a pre-existing issue: let's say I have a custom SHT_STRTAB section that isn't the symbol or section header string table. This code seems to prevent that section being emitted?



================
Comment at: llvm/test/tools/obj2yaml/duplicate-symbol-and-section-names.test:128
 
-# CASE3:      --- !ELF
-# CASE3-NEXT: FileHeader:
-# CASE3-NEXT:   Class:   ELFCLASS64
-# CASE3-NEXT:   Data:    ELFDATA2LSB
-# CASE3-NEXT:   Type:    ET_DYN
-# CASE3-NEXT:   Machine: EM_X86_64
-# CASE3-NEXT: Symbols:
+# CASE3:      Symbols:
 # CASE3-NEXT:   - Name:    foo
----------------
Unrelated change which should probably be committed separately?


================
Comment at: llvm/test/tools/obj2yaml/implicit-sections-order.yaml:7
+## .strtab (SHT_STRTAB) and .shstrtab (SHT_STRTAB) are not.
+## Check we print allocatable sections.
+
----------------
Here and below, maybe instead of "print" you should say "explicitly declare" or something to that effect?


================
Comment at: llvm/test/tools/obj2yaml/implicit-sections-order.yaml:114
+
+## Now test the ubnormal case: when .symtab (SHT_SYMTAB),
+## .strtab (SHT_STRTAB) and .shstrtab (SHT_STRTAB) are
----------------
ubnormal -> abnormal


================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:245
+      // file. We still dump them so that their positions in the section header
+      // table are correctly recorded. We only dump allocatable sections.
+      // Another ones, like .symtab or .strtab normally are not allocatable and
----------------
Perhaps worth saying why we only dump allocatable sections a little more directly.


================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:246
+      // table are correctly recorded. We only dump allocatable sections.
+      // Another ones, like .symtab or .strtab normally are not allocatable and
+      // do not have virtual address. We want to avoid noise in the YAML output
----------------
Another ones -> Some sections


================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:247
+      // Another ones, like .symtab or .strtab normally are not allocatable and
+      // do not have virtual address. We want to avoid noise in the YAML output
+      // and assume that they are placed at the end.
----------------
address -> addresses


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

https://reviews.llvm.org/D74955





More information about the llvm-commits mailing list