[PATCH] D75342: [obj2yaml] - Teach tool to dump program headers.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 19 03:44:58 PDT 2020


grimar planned changes to this revision.
grimar marked 2 inline comments as done.
grimar added inline comments.


================
Comment at: llvm/tools/obj2yaml/elf2yaml.cpp:196
+      ELFYAML::Section &S = cast<ELFYAML::Section>(*C);
+      if ((S.Flags.getValueOr(ELFYAML::ELF_SHF(0)) & ELF::SHF_ALLOC) &&
+          isInSegment<ELFT>(S, Phdr))
----------------
jhenderson wrote:
> As noted in the test, this SHF_ALLOC check is incorrect. It doesn't faithfully recreate what was in the object, and doesn't allow for non-loadable segments. Please remove it.
The approach used by this patch won't work then.     

We do not create `Chunk`s for non-allocatable `SHT_STRTAB`, `SHT_SYMTAB` and `SHT_DYNSYM`,
so iterating over `Chunks` does not work for non-allocatable case in general.



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

https://reviews.llvm.org/D75342





More information about the llvm-commits mailing list