[PATCH] D76706: [llvm-readobj] - Fix the crash when DT_STRTAB is broken.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 07:01:01 PDT 2020


grimar added inline comments.


================
Comment at: llvm/lib/Object/ELF.cpp:586-589
+    return createError("can't map virtual address 0x" +
+                       Twine::utohexstr(VAddr) + " to a segment with index " +
+                       Twine(&Phdr - (*ProgramHeadersOrError).data() + 1) +
+                       ": offset goes past the end of file");
----------------
jhenderson wrote:
> I wonder if this error message could be a little clearer. It's really an issue with the segment properties rather than the virtual address itself. Would something like "can't map virtual address 0x1234 to the segment with index 1: the segment goes past the end of the file" feel okay? Optionally even add in information about the segment end and file size to the message.
I've updated the message shown to refine and include more information. What do you think about it?


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

https://reviews.llvm.org/D76706





More information about the llvm-commits mailing list