[PATCH] D93209: [libObject, llvm-readobj] - Reimplement `ELFFile<ELFT>::getEntry`.

Harald van Dijk via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 20 10:26:00 PST 2020


hvdijk added inline comments.


================
Comment at: llvm/include/llvm/Object/ELF.h:629
+    return createError("can't read an entry at 0x" +
+                       Twine::utohexstr(Entry * sizeof(T)) +
+                       ": it goes past the end of the section (0x" +
----------------
This multiplication does not produce consistent results across hosts, as size_t may or may not be 64 bits so the result may or may not be truncated to 32 bits. It's fairly harmless since it's just the error message that's affected, but it causes test failures on some hosts. The original code cast Entry to uint64_t before multiplying, I think the new code needs to do the same.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93209



More information about the llvm-commits mailing list