[PATCH] D146534: [llvm-nm] Print EC symbol map.

Jacek Caban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 10:35:14 PDT 2023


jacek added a comment.

In D146534#4210803 <https://reviews.llvm.org/D146534#4210803>, @efriedma wrote:

> This code seems like it isn't being careful to ensure calls to read16le/read32le/etc. don't read past the end of a buffer. Maybe it makes sense to add some sort of bounds-checked read helper?  Maybe could leave it for a followup, though, if it's confusing to mix it in with this patch.

I originally followed how current code does, which just assumes that symbol table is valid. The problem with bounds-checked helper is that we don't really have a good way of propagating errors from things like iterators. In the new version, I added an early validation of EC symbols map so that if it's present, we know that all those reads are safe. I wasn't sure what to do when the map is invalid. We could treat it as an error in Archive constructor, but I decided to just ignore the map instead assuming that the archive may still be useful.


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

https://reviews.llvm.org/D146534



More information about the llvm-commits mailing list