[PATCH] D85830: [llvm-readobj/elf] - Cleanup helpers that are used to print segment types. NFCI.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 01:26:14 PDT 2020


jhenderson accepted this revision.
jhenderson added a comment.
This revision is now accepted and ready to land.

> get rid of one of macro.

"get rid of one macro"

LGTM, since we're not making the behaviour worse, but it would be nice to add support for the PT_OPENBSD versions in GNU mode too, unless there's a compelling reason not to. That can be a separate change though.



================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:1709-1710
+  StringRef Seg = segmentTypeToString(Arch, Type);
+  // GNU doesn't recognize PT_OPENBSD_*.
+  if (Seg.empty() || Seg.startswith("PT_OPENBSD_"))
+    return std::string("<unknown>: ") + to_string(format_hex(Type, 1));
----------------
I'm curious what others here think, but I don't think we need to emulate GNU's behaviour where they simply don't recognise a specific PT_* value (unless it clashes with another value). It seems to me like the better thing to do would be to ask GNU to add support for it in binutils.


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

https://reviews.llvm.org/D85830



More information about the llvm-commits mailing list