[PATCH] D71418: [llvm-readobj] - Fix letters used for dumping section types in GNU style.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 07:20:13 PST 2019


grimar marked an inline comment as done.
grimar added inline comments.


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:1447-1448
+  ENUM_ENT(SHF_EXCLUDE,          "E"),
   ENUM_ENT(SHF_MASKOS,           "o"),
   ENUM_ENT(SHF_MASKPROC,         "p"),
 };
----------------
grimar wrote:
> jhenderson wrote:
> > Should we test these two too? It looks like there's no testing here, but GNU supposedly prints them (I have not verified that this is the case).
> It is similar to
> https://reviews.llvm.org/D71333#inline-644830
> (i.e. this follow-up for D71333 is in my TODO list and waits for D71411 that have be landed first)
> 
> (I actually working on follow-ups we discussed, and made this patch because plan to
> remove these 2 from this array (because they are masks).)
> but GNU supposedly prints them (I have not verified that this is the case)
Yes, it does print `o` and `p`. For example, we have a sample in D71333:

```
--- !ELF
FileHeader:
  Class:   ELFCLASS32
  Data:    ELFDATA2LSB
  Type:    ET_REL
  Machine: EM_MIPS
Sections:
  - Name:  .mips
    Type:  SHT_PROGBITS
    Flags: [ SHF_MIPS_NODUPES, SHF_MIPS_NAMES, SHF_MIPS_LOCAL, SHF_MIPS_NOSTRIP,
              SHF_MIPS_GPREL, SHF_MIPS_MERGE, SHF_MIPS_ADDR, SHF_MIPS_STRING ]
```

GNU prints:
```
 [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
   [ 0]                   NULL            00000000 000000 000000 00      0   0  0
   [ 1] .mips             PROGBITS        00000000 000034 000000 00 Dop  0   0  0
```




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

https://reviews.llvm.org/D71418





More information about the llvm-commits mailing list