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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 10:04:44 PDT 2020


MaskRay added inline comments.


================
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));
----------------
grimar wrote:
> jhenderson wrote:
> > 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.
> > 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
> 
> I agree that we probably shouldn't and might want to go ahead and remove this condition in a follow-up even without waiting for GNU. Cleanup/refactoring changes (like this patch) are better to be NFC anyways too though.
> 
> I'll re-check what the latest binutils code do here and probably submit a bug for them.
Agree


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85830



More information about the llvm-commits mailing list