[PATCH] D92098: [obj2yaml] - Dump the `EShNum` key in some cases.
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 27 00:14:31 PST 2020
jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.
LGTM, with the suggested comment fixes.
================
Comment at: llvm/test/tools/obj2yaml/ELF/eshnum.yaml:1
+## Check cases related to the value of the e_shnum field of the ELF header live here.
+
----------------
================
Comment at: llvm/test/tools/obj2yaml/ELF/eshnum.yaml:7
+## the real number of entries in the section header table is held in the sh_size
+## member of the initial entry in section header table.
+
----------------
================
Comment at: llvm/test/tools/obj2yaml/ELF/eshnum.yaml:10
+## In the test case below we have an object that has e_shnum = 0 and the real
+## number of sections written to the sh_size member of the initial entry in
+## the section header table. Check that we emit the `EShNum` key properly.
----------------
================
Comment at: llvm/test/tools/obj2yaml/ELF/eshnum.yaml:40-42
+## file offset and the null value in the sh_size member of the initial entry of
+## the section header table. Here we check that we are able to dump such
+## objects properly.
----------------
================
Comment at: llvm/test/tools/obj2yaml/ELF/eshnum.yaml:56
+
+## In the test case below we have an object without the section header table and e_shnum == 0.
+## Document how we dump it.
----------------
================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:297-299
+ // header table is larger than or equal to SHN_LORESERVE (0xff00). In this
+ // case the real number of entries in the section header table is held in the
+ // sh_size member of the initial entry in section header table.
----------------
I think you can make this more concise like this.
================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:300
+ // sh_size member of the initial entry in section header table.
+ // We have the section header table when the `e_shoff` is not 0.
+ if (Obj.getHeader().e_shoff != 0 && Obj.getHeader().e_shnum == 0)
----------------
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92098/new/
https://reviews.llvm.org/D92098
More information about the llvm-commits
mailing list