[PATCH] D88817: [llvm-readobj/elf] - Ignore the hash table when on EM_S390/EM_ALPHA platforms.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 9 00:30:33 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/hash-table.test:61
+
+## We don't report warnings about the unsipported hash table on EM_S390 and EM_ALPHA platforms
+## when --hash-table is not requested.
----------------



================
Comment at: llvm/test/tools/llvm-readobj/ELF/hash-table.test:69
+
+# NOWARN: warning: '[[FILE]]': string table was not found
+
----------------
Seems like we shouldn't be getting this warning either, but that's presumably a separate change and more general. Perhaps add a TODO?


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:334-335
+    // sections. This violates the ELF specification.
+    if (Obj.getHeader().e_machine != ELF::EM_S390 &&
+        Obj.getHeader().e_machine != ELF::EM_ALPHA)
+      return 4;
----------------
I don't know why, but I'd find it slightly easier to follow this logic if it was inverted, i.e. check whether the machine is (not "is not") S390/Alpha, then return 8 if so.


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

https://reviews.llvm.org/D88817



More information about the llvm-commits mailing list