[PATCH] D49369: [llvm-readobj] - Teach tool to dump objects with >= SHN_LORESERVE of sections.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 17 06:22:12 PDT 2018


jhenderson added inline comments.


================
Comment at: test/tools/llvm-readobj/many-sections.s:25
+## many-sections-stripped.elf-x86_64 is many-sections.elf-x86_64 with
+## e_shoff field set to null (so, the section header is stripped).
+
----------------
I'd use the term "zero" rather than null here, since it's just a value.


================
Comment at: tools/llvm-readobj/ELFDumper.cpp:2492-2493
+  ArrayRef<typename ELFT::Shdr> Arr = unwrapOrError(Obj->sections());
+  if (Arr.empty())
+    return "0 (corrupt: out of range)";
+  return to_string(ElfHeader->e_shstrndx) + " (" + to_string(Arr[0].sh_link) + ")";
----------------
I'm not seeing this behaviour in readelf? If there are no section headers, I just get a value of 0 for the section header string table index, and no warning. A non-zero value on the other hand, when there are no sections (or indeed any value outside that range) does give me that error.


https://reviews.llvm.org/D49369





More information about the llvm-commits mailing list