[PATCH] D52821: [Disassembler][llvm-readobj] ELF note dumper abstraction

Tim Renouf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 5 01:08:42 PDT 2018


tpr added inline comments.


================
Comment at: tools/llvm-readobj/ELFDumper.cpp:3811
+        }
+      }
+      if (!Dumped)
----------------
compnerd wrote:
> I'm not sure if I really like this approach.  We already have the name that identifies who should interpret the note.  There is nothing that prevents the use of the `aarch64-unknown-windows-msvc-elf` to use the "AMD" vendor namespace to add a note.  However, I don't think that any target registered will have that triple.  How would that work?
This code just asks each registered (i.e. compiled in) target if it understands the note, and ignores the triples. So if the aarch64 target is compiled in and it decides to dump an AMD note type, it can.

We have the vendor name from the note, but that does not help identify the target.

Are you objecting to the whole point of this patch, to be able to delegate target-specific notes into targets and move the knowledge of them out of generic code in lib/BinaryFormat?


Repository:
  rL LLVM

https://reviews.llvm.org/D52821





More information about the llvm-commits mailing list